2 * FiberChannel transport specific attributes exported to sysfs.
4 * Copyright (c) 2003 Silicon Graphics, Inc. All rights reserved.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 #ifndef SCSI_TRANSPORT_FC_H
21 #define SCSI_TRANSPORT_FC_H
23 #include <linux/config.h>
25 struct scsi_transport_template;
27 struct fc_starget_attrs { /* aka fc_target_attrs */
31 uint32_t dev_loss_tmo; /* Remote Port loss timeout in seconds. */
32 struct timer_list dev_loss_timer;
35 #define fc_starget_port_id(x) \
36 (((struct fc_starget_attrs *)&(x)->starget_data)->port_id)
37 #define fc_starget_node_name(x) \
38 (((struct fc_starget_attrs *)&(x)->starget_data)->node_name)
39 #define fc_starget_port_name(x) \
40 (((struct fc_starget_attrs *)&(x)->starget_data)->port_name)
41 #define fc_starget_dev_loss_tmo(x) \
42 (((struct fc_starget_attrs *)&(x)->starget_data)->dev_loss_tmo)
43 #define fc_starget_dev_loss_timer(x) \
44 (((struct fc_starget_attrs *)&(x)->starget_data)->dev_loss_timer)
46 struct fc_host_attrs {
47 uint32_t link_down_tmo; /* Link Down timeout in seconds. */
48 struct timer_list link_down_timer;
51 #define fc_host_link_down_tmo(x) \
52 (((struct fc_host_attrs *)(x)->shost_data)->link_down_tmo)
53 #define fc_host_link_down_timer(x) \
54 (((struct fc_host_attrs *)(x)->shost_data)->link_down_timer)
57 /* The functions by which the transport class and the driver communicate */
58 struct fc_function_template {
59 void (*get_starget_port_id)(struct scsi_target *);
60 void (*get_starget_node_name)(struct scsi_target *);
61 void (*get_starget_port_name)(struct scsi_target *);
62 void (*get_starget_dev_loss_tmo)(struct scsi_target *);
63 void (*set_starget_dev_loss_tmo)(struct scsi_target *, uint32_t);
65 void (*get_host_link_down_tmo)(struct Scsi_Host *);
66 void (*set_host_link_down_tmo)(struct Scsi_Host *, uint32_t);
69 * The driver sets these to tell the transport class it
70 * wants the attributes displayed in sysfs. If the show_ flag
71 * is not set, the attribute will be private to the transport
74 unsigned long show_starget_port_id:1;
75 unsigned long show_starget_node_name:1;
76 unsigned long show_starget_port_name:1;
77 unsigned long show_starget_dev_loss_tmo:1;
79 unsigned long show_host_link_down_tmo:1;
81 /* Private Attributes */
84 struct scsi_transport_template *fc_attach_transport(struct fc_function_template *);
85 void fc_release_transport(struct scsi_transport_template *);
86 int fc_target_block(struct scsi_target *starget);
87 void fc_target_unblock(struct scsi_target *starget);
88 int fc_host_block(struct Scsi_Host *shost);
89 void fc_host_unblock(struct Scsi_Host *shost);
91 #endif /* SCSI_TRANSPORT_FC_H */