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

TOMOYO Linux Cross Reference
Linux/include/scsi/scsi_transport.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-only */
  2 /* 
  3  *  Transport specific attributes.
  4  *
  5  *  Copyright (c) 2003 Silicon Graphics, Inc.  All rights reserved.
  6  */
  7 #ifndef SCSI_TRANSPORT_H
  8 #define SCSI_TRANSPORT_H
  9 
 10 #include <linux/transport_class.h>
 11 #include <linux/blkdev.h>
 12 #include <linux/bug.h>
 13 #include <scsi/scsi_host.h>
 14 #include <scsi/scsi_device.h>
 15 
 16 struct scsi_transport_template {
 17         /* the attribute containers */
 18         struct transport_container host_attrs;
 19         struct transport_container target_attrs;
 20         struct transport_container device_attrs;
 21 
 22         /*
 23          * If set, called from sysfs and legacy procfs rescanning code.
 24          */
 25         int (*user_scan)(struct Scsi_Host *, uint, uint, u64);
 26 
 27         /* The size of the specific transport attribute structure (a
 28          * space of this size will be left at the end of the
 29          * scsi_* structure */
 30         int     device_size;
 31         int     device_private_offset;
 32         int     target_size;
 33         int     target_private_offset;
 34         int     host_size;
 35         /* no private offset for the host; there's an alternative mechanism */
 36 
 37         /*
 38          * True if the transport wants to use a host-based work-queue
 39          */
 40         unsigned int create_work_queue : 1;
 41 
 42         /*
 43          * Allows a transport to override the default error handler.
 44          */
 45         void (* eh_strategy_handler)(struct Scsi_Host *);
 46 };
 47 
 48 #define transport_class_to_shost(tc) \
 49         dev_to_shost((tc)->parent)
 50 
 51 
 52 /* Private area maintenance. The driver requested allocations come
 53  * directly after the transport class allocations (if any).  The idea
 54  * is that you *must* call these only once.  The code assumes that the
 55  * initial values are the ones the transport specific code requires */
 56 static inline void
 57 scsi_transport_reserve_target(struct scsi_transport_template * t, int space)
 58 {
 59         BUG_ON(t->target_private_offset != 0);
 60         t->target_private_offset = ALIGN(t->target_size, sizeof(void *));
 61         t->target_size = t->target_private_offset + space;
 62 }
 63 static inline void
 64 scsi_transport_reserve_device(struct scsi_transport_template * t, int space)
 65 {
 66         BUG_ON(t->device_private_offset != 0);
 67         t->device_private_offset = ALIGN(t->device_size, sizeof(void *));
 68         t->device_size = t->device_private_offset + space;
 69 }
 70 static inline void *
 71 scsi_transport_target_data(struct scsi_target *starget)
 72 {
 73         struct Scsi_Host *shost = dev_to_shost(&starget->dev);
 74         return (u8 *)starget->starget_data
 75                 + shost->transportt->target_private_offset;
 76 
 77 }
 78 static inline void *
 79 scsi_transport_device_data(struct scsi_device *sdev)
 80 {
 81         struct Scsi_Host *shost = sdev->host;
 82         return (u8 *)sdev->sdev_data
 83                 + shost->transportt->device_private_offset;
 84 }
 85 
 86 void scsi_init_limits(struct Scsi_Host *shost, struct queue_limits *lim);
 87 
 88 #endif /* SCSI_TRANSPORT_H */
 89 

~ [ 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