diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-31 15:02:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-31 15:02:41 -0400 |
commit | 054552272e6e152ff40f8b7f164dd390a5a62097 (patch) | |
tree | 9be4ee91a0ea090672f6ea1be2f6e6eef027d810 /include | |
parent | 5b461209d07ab9a9284760f6ffe696de558031a3 (diff) | |
parent | 1ff2f40305772b159a91c19590ee159d3a504afc (diff) |
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull final round of SCSI updates from James Bottomley:
"This is primarily another round of driver updates (bnx2fc, qla2xxx,
qla4xxx) including the target mode driver for qla2xxx. We've also got
a couple of regression fixes (async scanning, broken this merge window
and a fix to a long standing break in the scsi_wait_scan module)."
* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (45 commits)
[SCSI] fix scsi_wait_scan
[SCSI] fix async probe regression
[SCSI] be2iscsi: fix dma free size mismatch regression
[SCSI] qla4xxx: Update driver version to 5.02.00-k17
[SCSI] qla4xxx: Capture minidump for ISP82XX on firmware failure
[SCSI] qla4xxx: Add change_queue_depth API support
[SCSI] qla4xxx: Fix clear ddb mbx command failure issue.
[SCSI] qla4xxx: Fix kernel panic during discovery logout.
[SCSI] qla4xxx: Correct early completion of pending mbox.
[SCSI] fcoe, bnx2fc, libfcoe: SW FCoE and bnx2fc use FCoE Syfs
[SCSI] libfcoe: Add fcoe_sysfs
[SCSI] bnx2fc: Allocate fcoe_ctlr with bnx2fc_interface, not as a member
[SCSI] fcoe: Allocate fcoe_ctlr with fcoe_interface, not as a member
[SCSI] Fix dm-multipath starvation when scsi host is busy
[SCSI] ufs: fix potential NULL pointer dereferencing error in ufshcd_prove.
[SCSI] qla2xxx: don't free pool that wasn't allocated
[SCSI] mptfusion: unlock on error in mpt_config()
[SCSI] tcm_qla2xxx: Add >= 24xx series fabric module for target-core
[SCSI] qla2xxx: Add LLD target-mode infrastructure for >= 24xx series
[SCSI] Revert "qla2xxx: During loopdown perform Diagnostic loopback."
...
Diffstat (limited to 'include')
-rw-r--r-- | include/scsi/fcoe_sysfs.h | 124 | ||||
-rw-r--r-- | include/scsi/libfcoe.h | 27 |
2 files changed, 151 insertions, 0 deletions
diff --git a/include/scsi/fcoe_sysfs.h b/include/scsi/fcoe_sysfs.h new file mode 100644 index 000000000000..604cb9bb3e76 --- /dev/null +++ b/include/scsi/fcoe_sysfs.h | |||
@@ -0,0 +1,124 @@ | |||
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 | |||
30 | struct fcoe_sysfs_function_template { | ||
31 | void (*get_fcoe_ctlr_link_fail)(struct fcoe_ctlr_device *); | ||
32 | void (*get_fcoe_ctlr_vlink_fail)(struct fcoe_ctlr_device *); | ||
33 | void (*get_fcoe_ctlr_miss_fka)(struct fcoe_ctlr_device *); | ||
34 | void (*get_fcoe_ctlr_symb_err)(struct fcoe_ctlr_device *); | ||
35 | void (*get_fcoe_ctlr_err_block)(struct fcoe_ctlr_device *); | ||
36 | void (*get_fcoe_ctlr_fcs_error)(struct fcoe_ctlr_device *); | ||
37 | void (*get_fcoe_ctlr_mode)(struct fcoe_ctlr_device *); | ||
38 | void (*get_fcoe_fcf_selected)(struct fcoe_fcf_device *); | ||
39 | void (*get_fcoe_fcf_vlan_id)(struct fcoe_fcf_device *); | ||
40 | }; | ||
41 | |||
42 | #define dev_to_ctlr(d) \ | ||
43 | container_of((d), struct fcoe_ctlr_device, dev) | ||
44 | |||
45 | enum fip_conn_type { | ||
46 | FIP_CONN_TYPE_UNKNOWN, | ||
47 | FIP_CONN_TYPE_FABRIC, | ||
48 | FIP_CONN_TYPE_VN2VN, | ||
49 | }; | ||
50 | |||
51 | struct fcoe_ctlr_device { | ||
52 | u32 id; | ||
53 | |||
54 | struct device dev; | ||
55 | struct fcoe_sysfs_function_template *f; | ||
56 | |||
57 | struct list_head fcfs; | ||
58 | char work_q_name[20]; | ||
59 | struct workqueue_struct *work_q; | ||
60 | char devloss_work_q_name[20]; | ||
61 | struct workqueue_struct *devloss_work_q; | ||
62 | struct mutex lock; | ||
63 | |||
64 | int fcf_dev_loss_tmo; | ||
65 | enum fip_conn_type mode; | ||
66 | |||
67 | /* expected in host order for displaying */ | ||
68 | struct fcoe_fc_els_lesb lesb; | ||
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 { | ||
78 | FCOE_FCF_STATE_UNKNOWN, | ||
79 | FCOE_FCF_STATE_DISCONNECTED, | ||
80 | FCOE_FCF_STATE_CONNECTED, | ||
81 | FCOE_FCF_STATE_DELETED, | ||
82 | }; | ||
83 | |||
84 | struct fcoe_fcf_device { | ||
85 | u32 id; | ||
86 | struct device dev; | ||
87 | struct list_head peers; | ||
88 | struct work_struct delete_work; | ||
89 | struct delayed_work dev_loss_work; | ||
90 | u32 dev_loss_tmo; | ||
91 | void *priv; | ||
92 | enum fcf_state state; | ||
93 | |||
94 | u64 fabric_name; | ||
95 | u64 switch_name; | ||
96 | u32 fc_map; | ||
97 | u16 vfid; | ||
98 | u8 mac[ETH_ALEN]; | ||
99 | u8 priority; | ||
100 | u32 fka_period; | ||
101 | u8 selected; | ||
102 | u16 vlan_id; | ||
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, | ||
114 | struct fcoe_sysfs_function_template *f, | ||
115 | int priv_size); | ||
116 | void fcoe_ctlr_device_delete(struct fcoe_ctlr_device *); | ||
117 | struct fcoe_fcf_device *fcoe_fcf_device_add(struct fcoe_ctlr_device *, | ||
118 | struct fcoe_fcf_device *); | ||
119 | void fcoe_fcf_device_delete(struct fcoe_fcf_device *); | ||
120 | |||
121 | int __init fcoe_sysfs_setup(void); | ||
122 | void __exit fcoe_sysfs_teardown(void); | ||
123 | |||
124 | #endif /* FCOE_SYSFS */ | ||
diff --git a/include/scsi/libfcoe.h b/include/scsi/libfcoe.h index cfdb55f0937e..22b07cc99808 100644 --- a/include/scsi/libfcoe.h +++ b/include/scsi/libfcoe.h | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/random.h> | 29 | #include <linux/random.h> |
30 | #include <scsi/fc/fc_fcoe.h> | 30 | #include <scsi/fc/fc_fcoe.h> |
31 | #include <scsi/libfc.h> | 31 | #include <scsi/libfc.h> |
32 | #include <scsi/fcoe_sysfs.h> | ||
32 | 33 | ||
33 | #define FCOE_MAX_CMD_LEN 16 /* Supported CDB length */ | 34 | #define FCOE_MAX_CMD_LEN 16 /* Supported CDB length */ |
34 | 35 | ||
@@ -159,8 +160,24 @@ struct fcoe_ctlr { | |||
159 | }; | 160 | }; |
160 | 161 | ||
161 | /** | 162 | /** |
163 | * fcoe_ctlr_priv() - Return the private data from a fcoe_ctlr | ||
164 | * @cltr: The fcoe_ctlr whose private data will be returned | ||
165 | */ | ||
166 | static inline void *fcoe_ctlr_priv(const struct fcoe_ctlr *ctlr) | ||
167 | { | ||
168 | return (void *)(ctlr + 1); | ||
169 | } | ||
170 | |||
171 | #define fcoe_ctlr_to_ctlr_dev(x) \ | ||
172 | (struct fcoe_ctlr_device *)(((struct fcoe_ctlr_device *)(x)) - 1) | ||
173 | |||
174 | /** | ||
162 | * struct fcoe_fcf - Fibre-Channel Forwarder | 175 | * struct fcoe_fcf - Fibre-Channel Forwarder |
163 | * @list: list linkage | 176 | * @list: list linkage |
177 | * @event_work: Work for FC Transport actions queue | ||
178 | * @event: The event to be processed | ||
179 | * @fip: The controller that the FCF was discovered on | ||
180 | * @fcf_dev: The associated fcoe_fcf_device instance | ||
164 | * @time: system time (jiffies) when an advertisement was last received | 181 | * @time: system time (jiffies) when an advertisement was last received |
165 | * @switch_name: WWN of switch from advertisement | 182 | * @switch_name: WWN of switch from advertisement |
166 | * @fabric_name: WWN of fabric from advertisement | 183 | * @fabric_name: WWN of fabric from advertisement |
@@ -182,6 +199,9 @@ struct fcoe_ctlr { | |||
182 | */ | 199 | */ |
183 | struct fcoe_fcf { | 200 | struct fcoe_fcf { |
184 | struct list_head list; | 201 | struct list_head list; |
202 | struct work_struct event_work; | ||
203 | struct fcoe_ctlr *fip; | ||
204 | struct fcoe_fcf_device *fcf_dev; | ||
185 | unsigned long time; | 205 | unsigned long time; |
186 | 206 | ||
187 | u64 switch_name; | 207 | u64 switch_name; |
@@ -198,6 +218,9 @@ struct fcoe_fcf { | |||
198 | u8 fd_flags:1; | 218 | u8 fd_flags:1; |
199 | }; | 219 | }; |
200 | 220 | ||
221 | #define fcoe_fcf_to_fcf_dev(x) \ | ||
222 | ((x)->fcf_dev) | ||
223 | |||
201 | /** | 224 | /** |
202 | * struct fcoe_rport - VN2VN remote port | 225 | * struct fcoe_rport - VN2VN remote port |
203 | * @time: time of create or last beacon packet received from node | 226 | * @time: time of create or last beacon packet received from node |
@@ -333,6 +356,10 @@ void fcoe_queue_timer(ulong lport); | |||
333 | int fcoe_get_paged_crc_eof(struct sk_buff *skb, int tlen, | 356 | int fcoe_get_paged_crc_eof(struct sk_buff *skb, int tlen, |
334 | struct fcoe_percpu_s *fps); | 357 | struct fcoe_percpu_s *fps); |
335 | 358 | ||
359 | /* FCoE Sysfs helpers */ | ||
360 | void fcoe_fcf_get_selected(struct fcoe_fcf_device *); | ||
361 | void fcoe_ctlr_get_fip_mode(struct fcoe_ctlr_device *); | ||
362 | |||
336 | /** | 363 | /** |
337 | * struct netdev_list | 364 | * struct netdev_list |
338 | * A mapping from netdevice to fcoe_transport | 365 | * A mapping from netdevice to fcoe_transport |