Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
fcoe_sysfs.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2012 Intel Corporation. All rights reserved.
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms and conditions of the GNU General Public License,
6  * version 2, as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope it will be useful, but WITHOUT
9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11  * more details.
12  *
13  * You should have received a copy of the GNU General Public License along with
14  * this program; if not, write to the Free Software Foundation, Inc.,
15  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
16  *
17  * Maintained at www.Open-FCoE.org
18  */
19 
20 #ifndef FCOE_SYSFS
21 #define FCOE_SYSFS
22 
23 #include <linux/if_ether.h>
24 #include <linux/device.h>
25 #include <scsi/fc/fc_fcoe.h>
26 
27 struct fcoe_ctlr_device;
28 struct fcoe_fcf_device;
29 
40 };
41 
42 #define dev_to_ctlr(d) \
43  container_of((d), struct fcoe_ctlr_device, dev)
44 
49 };
50 
53 
54  struct device dev;
56 
57  struct list_head fcfs;
58  char work_q_name[20];
62  struct mutex lock;
63 
66 
67  /* expected in host order for displaying */
69 };
70 
71 static inline void *fcoe_ctlr_device_priv(const struct fcoe_ctlr_device *ctlr)
72 {
73  return (void *)(ctlr + 1);
74 }
75 
76 /* fcf states */
77 enum fcf_state {
82 };
83 
86  struct device dev;
87  struct list_head peers;
91  void *priv;
93 
103 };
104 
105 #define dev_to_fcf(d) \
106  container_of((d), struct fcoe_fcf_device, dev)
107 /* parentage should never be missing */
108 #define fcoe_fcf_dev_to_ctlr_dev(x) \
109  dev_to_ctlr((x)->dev.parent)
110 #define fcoe_fcf_device_priv(x) \
111  ((x)->priv)
112 
113 struct fcoe_ctlr_device *fcoe_ctlr_device_add(struct device *parent,
115  int priv_size);
118  struct fcoe_fcf_device *);
120 
121 int __init fcoe_sysfs_setup(void);
122 void __exit fcoe_sysfs_teardown(void);
123 
124 #endif /* FCOE_SYSFS */