~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/scsi/scsi_transport_spi.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-or-later */
  2 /* 
  3  *  Parallel SCSI (SPI) transport specific attributes exported to sysfs.
  4  *
  5  *  Copyright (c) 2003 Silicon Graphics, Inc.  All rights reserved.
  6  */
  7 #ifndef SCSI_TRANSPORT_SPI_H
  8 #define SCSI_TRANSPORT_SPI_H
  9 
 10 #include <linux/transport_class.h>
 11 #include <linux/mutex.h>
 12 
 13 struct scsi_transport_template;
 14 struct scsi_target;
 15 struct scsi_device;
 16 struct Scsi_Host;
 17 
 18 struct spi_transport_attrs {
 19         int period;             /* value in the PPR/SDTR command */
 20         int min_period;
 21         int offset;
 22         int max_offset;
 23         unsigned int width:1;   /* 0 - narrow, 1 - wide */
 24         unsigned int max_width:1;
 25         unsigned int iu:1;      /* Information Units enabled */
 26         unsigned int max_iu:1;
 27         unsigned int dt:1;      /* DT clocking enabled */
 28         unsigned int qas:1;     /* Quick Arbitration and Selection enabled */
 29         unsigned int max_qas:1;
 30         unsigned int wr_flow:1; /* Write Flow control enabled */
 31         unsigned int rd_strm:1; /* Read streaming enabled */
 32         unsigned int rti:1;     /* Retain Training Information */
 33         unsigned int pcomp_en:1;/* Precompensation enabled */
 34         unsigned int hold_mcs:1;/* Hold Margin Control Settings */
 35         unsigned int initial_dv:1; /* DV done to this target yet  */
 36         unsigned long flags;    /* flags field for drivers to use */
 37         /* Device Properties fields */
 38         unsigned int support_sync:1; /* synchronous support */
 39         unsigned int support_wide:1; /* wide support */
 40         unsigned int support_dt:1; /* allows DT phases */
 41         unsigned int support_dt_only; /* disallows ST phases */
 42         unsigned int support_ius; /* support Information Units */
 43         unsigned int support_qas; /* supports quick arbitration and selection */
 44         /* Private Fields */
 45         unsigned int dv_pending:1; /* Internal flag: DV Requested */
 46         unsigned int dv_in_progress:1;  /* Internal: DV started */
 47         struct mutex dv_mutex; /* semaphore to serialise dv */
 48 };
 49 
 50 enum spi_signal_type {
 51         SPI_SIGNAL_UNKNOWN = 1,
 52         SPI_SIGNAL_SE,
 53         SPI_SIGNAL_LVD,
 54         SPI_SIGNAL_HVD,
 55 };
 56 
 57 struct spi_host_attrs {
 58         enum spi_signal_type signalling;
 59 };
 60 
 61 /* accessor functions */
 62 #define spi_period(x)   (((struct spi_transport_attrs *)&(x)->starget_data)->period)
 63 #define spi_min_period(x) (((struct spi_transport_attrs *)&(x)->starget_data)->min_period)
 64 #define spi_offset(x)   (((struct spi_transport_attrs *)&(x)->starget_data)->offset)
 65 #define spi_max_offset(x) (((struct spi_transport_attrs *)&(x)->starget_data)->max_offset)
 66 #define spi_width(x)    (((struct spi_transport_attrs *)&(x)->starget_data)->width)
 67 #define spi_max_width(x) (((struct spi_transport_attrs *)&(x)->starget_data)->max_width)
 68 #define spi_iu(x)       (((struct spi_transport_attrs *)&(x)->starget_data)->iu)
 69 #define spi_max_iu(x)   (((struct spi_transport_attrs *)&(x)->starget_data)->max_iu)
 70 #define spi_dt(x)       (((struct spi_transport_attrs *)&(x)->starget_data)->dt)
 71 #define spi_qas(x)      (((struct spi_transport_attrs *)&(x)->starget_data)->qas)
 72 #define spi_max_qas(x)  (((struct spi_transport_attrs *)&(x)->starget_data)->max_qas)
 73 #define spi_wr_flow(x)  (((struct spi_transport_attrs *)&(x)->starget_data)->wr_flow)
 74 #define spi_rd_strm(x)  (((struct spi_transport_attrs *)&(x)->starget_data)->rd_strm)
 75 #define spi_rti(x)      (((struct spi_transport_attrs *)&(x)->starget_data)->rti)
 76 #define spi_pcomp_en(x) (((struct spi_transport_attrs *)&(x)->starget_data)->pcomp_en)
 77 #define spi_hold_mcs(x) (((struct spi_transport_attrs *)&(x)->starget_data)->hold_mcs)
 78 #define spi_initial_dv(x)       (((struct spi_transport_attrs *)&(x)->starget_data)->initial_dv)
 79 #define spi_dv_pending(x) (((struct spi_transport_attrs *)&(x)->starget_data)->dv_pending)
 80 
 81 #define spi_support_sync(x)     (((struct spi_transport_attrs *)&(x)->starget_data)->support_sync)
 82 #define spi_support_wide(x)     (((struct spi_transport_attrs *)&(x)->starget_data)->support_wide)
 83 #define spi_support_dt(x)       (((struct spi_transport_attrs *)&(x)->starget_data)->support_dt)
 84 #define spi_support_dt_only(x)  (((struct spi_transport_attrs *)&(x)->starget_data)->support_dt_only)
 85 #define spi_support_ius(x)      (((struct spi_transport_attrs *)&(x)->starget_data)->support_ius)
 86 #define spi_support_qas(x)      (((struct spi_transport_attrs *)&(x)->starget_data)->support_qas)
 87 
 88 #define spi_flags(x)    (((struct spi_transport_attrs *)&(x)->starget_data)->flags)
 89 #define spi_signalling(h)       (((struct spi_host_attrs *)(h)->shost_data)->signalling)
 90 
 91 
 92 
 93 /* The functions by which the transport class and the driver communicate */
 94 struct spi_function_template {
 95         void    (*get_period)(struct scsi_target *);
 96         void    (*set_period)(struct scsi_target *, int);
 97         void    (*get_offset)(struct scsi_target *);
 98         void    (*set_offset)(struct scsi_target *, int);
 99         void    (*get_width)(struct scsi_target *);
100         void    (*set_width)(struct scsi_target *, int);
101         void    (*get_iu)(struct scsi_target *);
102         void    (*set_iu)(struct scsi_target *, int);
103         void    (*get_dt)(struct scsi_target *);
104         void    (*set_dt)(struct scsi_target *, int);
105         void    (*get_qas)(struct scsi_target *);
106         void    (*set_qas)(struct scsi_target *, int);
107         void    (*get_wr_flow)(struct scsi_target *);
108         void    (*set_wr_flow)(struct scsi_target *, int);
109         void    (*get_rd_strm)(struct scsi_target *);
110         void    (*set_rd_strm)(struct scsi_target *, int);
111         void    (*get_rti)(struct scsi_target *);
112         void    (*set_rti)(struct scsi_target *, int);
113         void    (*get_pcomp_en)(struct scsi_target *);
114         void    (*set_pcomp_en)(struct scsi_target *, int);
115         void    (*get_hold_mcs)(struct scsi_target *);
116         void    (*set_hold_mcs)(struct scsi_target *, int);
117         void    (*get_signalling)(struct Scsi_Host *);
118         void    (*set_signalling)(struct Scsi_Host *, enum spi_signal_type);
119         int     (*deny_binding)(struct scsi_target *);
120         /* The driver sets these to tell the transport class it
121          * wants the attributes displayed in sysfs.  If the show_ flag
122          * is not set, the attribute will be private to the transport
123          * class */
124         unsigned long   show_period:1;
125         unsigned long   show_offset:1;
126         unsigned long   show_width:1;
127         unsigned long   show_iu:1;
128         unsigned long   show_dt:1;
129         unsigned long   show_qas:1;
130         unsigned long   show_wr_flow:1;
131         unsigned long   show_rd_strm:1;
132         unsigned long   show_rti:1;
133         unsigned long   show_pcomp_en:1;
134         unsigned long   show_hold_mcs:1;
135 };
136 
137 struct scsi_transport_template *spi_attach_transport(struct spi_function_template *);
138 void spi_release_transport(struct scsi_transport_template *);
139 void spi_schedule_dv_device(struct scsi_device *);
140 void spi_dv_device(struct scsi_device *);
141 void spi_display_xfer_agreement(struct scsi_target *);
142 int spi_print_msg(const unsigned char *);
143 int spi_populate_width_msg(unsigned char *msg, int width);
144 int spi_populate_sync_msg(unsigned char *msg, int period, int offset);
145 int spi_populate_ppr_msg(unsigned char *msg, int period, int offset, int width,
146                 int options);
147 int spi_populate_tag_msg(unsigned char *msg, struct scsi_cmnd *cmd);
148 
149 #endif /* SCSI_TRANSPORT_SPI_H */
150 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php