ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / include / scsi / scsi_transport_fc.h
1 /* 
2  *  FiberChannel transport specific attributes exported to sysfs.
3  *
4  *  Copyright (c) 2003 Silicon Graphics, Inc.  All rights reserved.
5  *
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.
10  *
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.
15  *
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
19  */
20 #ifndef SCSI_TRANSPORT_FC_H
21 #define SCSI_TRANSPORT_FC_H
22
23 #include <linux/config.h>
24
25 struct scsi_transport_template;
26
27 struct fc_transport_attrs {
28         int port_id;
29         uint64_t node_name;
30         uint64_t port_name;
31 };
32
33 /* accessor functions */
34 #define fc_port_id(x)   (((struct fc_transport_attrs *)&(x)->transport_data)->port_id)
35 #define fc_node_name(x) (((struct fc_transport_attrs *)&(x)->transport_data)->node_name)
36 #define fc_port_name(x) (((struct fc_transport_attrs *)&(x)->transport_data)->port_name)
37
38 /* The functions by which the transport class and the driver communicate */
39 struct fc_function_template {
40         void    (*get_port_id)(struct scsi_device *);
41         void    (*get_node_name)(struct scsi_device *);
42         void    (*get_port_name)(struct scsi_device *);
43         /* The driver sets these to tell the transport class it
44          * wants the attributes displayed in sysfs.  If the show_ flag
45          * is not set, the attribute will be private to the transport
46          * class */
47         unsigned long   show_port_id:1;
48         unsigned long   show_node_name:1;
49         unsigned long   show_port_name:1;
50         /* Private Attributes */
51 };
52
53 struct scsi_transport_template *fc_attach_transport(struct fc_function_template *);
54 void fc_release_transport(struct scsi_transport_template *);
55
56 #endif /* SCSI_TRANSPORT_FC_H */