diff options
author | Yi Zou <yi.zou@intel.com> | 2012-12-06 01:24:13 -0500 |
---|---|---|
committer | Robert Love <robert.w.love@intel.com> | 2012-12-14 13:38:55 -0500 |
commit | 57c2728fa806aff08703e5739620454d723bc865 (patch) | |
tree | 4dda55f3f75f367a882718ff61b99a7e650a0e1c /drivers/scsi | |
parent | 03702689fcc985e9cb45b57099ebd5066f674739 (diff) |
libfcoe, fcoe: consolidate the fcoe_ctlr_get_lesb/fcoe_get_lesb
Similarly they can be moved into libfcoe instead of being private to fcoe now.
Also add comments particularly on the term LESB to the corresponding function.
Signed-off-by: Yi Zou <yi.zou@intel.com>
Cc: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Tested-by: Marcus Dennis <marcusx.e.dennis@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/fcoe/fcoe.c | 40 | ||||
-rw-r--r-- | drivers/scsi/fcoe/fcoe_transport.c | 54 |
2 files changed, 54 insertions, 40 deletions
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c index 64bb53156af0..0b333681a645 100644 --- a/drivers/scsi/fcoe/fcoe.c +++ b/drivers/scsi/fcoe/fcoe.c | |||
@@ -130,8 +130,6 @@ static struct fc_seq *fcoe_elsct_send(struct fc_lport *, | |||
130 | void *, u32 timeout); | 130 | void *, u32 timeout); |
131 | static void fcoe_recv_frame(struct sk_buff *skb); | 131 | static void fcoe_recv_frame(struct sk_buff *skb); |
132 | 132 | ||
133 | static void fcoe_get_lesb(struct fc_lport *, struct fc_els_lesb *); | ||
134 | |||
135 | /* notification function for packets from net device */ | 133 | /* notification function for packets from net device */ |
136 | static struct notifier_block fcoe_notifier = { | 134 | static struct notifier_block fcoe_notifier = { |
137 | .notifier_call = fcoe_device_notification, | 135 | .notifier_call = fcoe_device_notification, |
@@ -155,7 +153,6 @@ static int fcoe_vport_create(struct fc_vport *, bool disabled); | |||
155 | static int fcoe_vport_disable(struct fc_vport *, bool disable); | 153 | static int fcoe_vport_disable(struct fc_vport *, bool disable); |
156 | static void fcoe_set_vport_symbolic_name(struct fc_vport *); | 154 | static void fcoe_set_vport_symbolic_name(struct fc_vport *); |
157 | static void fcoe_set_port_id(struct fc_lport *, u32, struct fc_frame *); | 155 | static void fcoe_set_port_id(struct fc_lport *, u32, struct fc_frame *); |
158 | static void fcoe_ctlr_get_lesb(struct fcoe_ctlr_device *); | ||
159 | static void fcoe_fcf_get_vlan_id(struct fcoe_fcf_device *); | 156 | static void fcoe_fcf_get_vlan_id(struct fcoe_fcf_device *); |
160 | 157 | ||
161 | static struct fcoe_sysfs_function_template fcoe_sysfs_templ = { | 158 | static struct fcoe_sysfs_function_template fcoe_sysfs_templ = { |
@@ -2858,43 +2855,6 @@ static void fcoe_set_vport_symbolic_name(struct fc_vport *vport) | |||
2858 | NULL, NULL, 3 * lport->r_a_tov); | 2855 | NULL, NULL, 3 * lport->r_a_tov); |
2859 | } | 2856 | } |
2860 | 2857 | ||
2861 | /** | ||
2862 | * fcoe_get_lesb() - Fill the FCoE Link Error Status Block | ||
2863 | * @lport: the local port | ||
2864 | * @fc_lesb: the link error status block | ||
2865 | */ | ||
2866 | static void fcoe_get_lesb(struct fc_lport *lport, | ||
2867 | struct fc_els_lesb *fc_lesb) | ||
2868 | { | ||
2869 | struct net_device *netdev = fcoe_netdev(lport); | ||
2870 | |||
2871 | __fcoe_get_lesb(lport, fc_lesb, netdev); | ||
2872 | } | ||
2873 | |||
2874 | static void fcoe_ctlr_get_lesb(struct fcoe_ctlr_device *ctlr_dev) | ||
2875 | { | ||
2876 | struct fcoe_ctlr *fip = fcoe_ctlr_device_priv(ctlr_dev); | ||
2877 | struct net_device *netdev = fcoe_netdev(fip->lp); | ||
2878 | struct fcoe_fc_els_lesb *fcoe_lesb; | ||
2879 | struct fc_els_lesb fc_lesb; | ||
2880 | |||
2881 | __fcoe_get_lesb(fip->lp, &fc_lesb, netdev); | ||
2882 | fcoe_lesb = (struct fcoe_fc_els_lesb *)(&fc_lesb); | ||
2883 | |||
2884 | ctlr_dev->lesb.lesb_link_fail = | ||
2885 | ntohl(fcoe_lesb->lesb_link_fail); | ||
2886 | ctlr_dev->lesb.lesb_vlink_fail = | ||
2887 | ntohl(fcoe_lesb->lesb_vlink_fail); | ||
2888 | ctlr_dev->lesb.lesb_miss_fka = | ||
2889 | ntohl(fcoe_lesb->lesb_miss_fka); | ||
2890 | ctlr_dev->lesb.lesb_symb_err = | ||
2891 | ntohl(fcoe_lesb->lesb_symb_err); | ||
2892 | ctlr_dev->lesb.lesb_err_block = | ||
2893 | ntohl(fcoe_lesb->lesb_err_block); | ||
2894 | ctlr_dev->lesb.lesb_fcs_error = | ||
2895 | ntohl(fcoe_lesb->lesb_fcs_error); | ||
2896 | } | ||
2897 | |||
2898 | static void fcoe_fcf_get_vlan_id(struct fcoe_fcf_device *fcf_dev) | 2858 | static void fcoe_fcf_get_vlan_id(struct fcoe_fcf_device *fcf_dev) |
2899 | { | 2859 | { |
2900 | struct fcoe_ctlr_device *ctlr_dev = | 2860 | struct fcoe_ctlr_device *ctlr_dev = |
diff --git a/drivers/scsi/fcoe/fcoe_transport.c b/drivers/scsi/fcoe/fcoe_transport.c index 3c6846f1268b..dd1aeb45f4cd 100644 --- a/drivers/scsi/fcoe/fcoe_transport.c +++ b/drivers/scsi/fcoe/fcoe_transport.c | |||
@@ -118,6 +118,15 @@ int fcoe_link_speed_update(struct fc_lport *lport) | |||
118 | } | 118 | } |
119 | EXPORT_SYMBOL_GPL(fcoe_link_speed_update); | 119 | EXPORT_SYMBOL_GPL(fcoe_link_speed_update); |
120 | 120 | ||
121 | /** | ||
122 | * __fcoe_get_lesb() - Get the Link Error Status Block (LESB) for a given lport | ||
123 | * @lport: The local port to update speeds for | ||
124 | * @fc_lesb: Pointer to the LESB to be filled up | ||
125 | * @netdev: Pointer to the netdev that is associated with the lport | ||
126 | * | ||
127 | * Note, the Link Error Status Block (LESB) for FCoE is defined in FC-BB-6 | ||
128 | * Clause 7.11 in v1.04. | ||
129 | */ | ||
121 | void __fcoe_get_lesb(struct fc_lport *lport, | 130 | void __fcoe_get_lesb(struct fc_lport *lport, |
122 | struct fc_els_lesb *fc_lesb, | 131 | struct fc_els_lesb *fc_lesb, |
123 | struct net_device *netdev) | 132 | struct net_device *netdev) |
@@ -147,6 +156,51 @@ void __fcoe_get_lesb(struct fc_lport *lport, | |||
147 | } | 156 | } |
148 | EXPORT_SYMBOL_GPL(__fcoe_get_lesb); | 157 | EXPORT_SYMBOL_GPL(__fcoe_get_lesb); |
149 | 158 | ||
159 | /** | ||
160 | * fcoe_get_lesb() - Fill the FCoE Link Error Status Block | ||
161 | * @lport: the local port | ||
162 | * @fc_lesb: the link error status block | ||
163 | */ | ||
164 | void fcoe_get_lesb(struct fc_lport *lport, | ||
165 | struct fc_els_lesb *fc_lesb) | ||
166 | { | ||
167 | struct net_device *netdev = fcoe_get_netdev(lport); | ||
168 | |||
169 | __fcoe_get_lesb(lport, fc_lesb, netdev); | ||
170 | } | ||
171 | EXPORT_SYMBOL_GPL(fcoe_get_lesb); | ||
172 | |||
173 | /** | ||
174 | * fcoe_ctlr_get_lesb() - Get the Link Error Status Block (LESB) for a given | ||
175 | * fcoe controller device | ||
176 | * @ctlr_dev: The given fcoe controller device | ||
177 | * | ||
178 | */ | ||
179 | void fcoe_ctlr_get_lesb(struct fcoe_ctlr_device *ctlr_dev) | ||
180 | { | ||
181 | struct fcoe_ctlr *fip = fcoe_ctlr_device_priv(ctlr_dev); | ||
182 | struct net_device *netdev = fcoe_get_netdev(fip->lp); | ||
183 | struct fcoe_fc_els_lesb *fcoe_lesb; | ||
184 | struct fc_els_lesb fc_lesb; | ||
185 | |||
186 | __fcoe_get_lesb(fip->lp, &fc_lesb, netdev); | ||
187 | fcoe_lesb = (struct fcoe_fc_els_lesb *)(&fc_lesb); | ||
188 | |||
189 | ctlr_dev->lesb.lesb_link_fail = | ||
190 | ntohl(fcoe_lesb->lesb_link_fail); | ||
191 | ctlr_dev->lesb.lesb_vlink_fail = | ||
192 | ntohl(fcoe_lesb->lesb_vlink_fail); | ||
193 | ctlr_dev->lesb.lesb_miss_fka = | ||
194 | ntohl(fcoe_lesb->lesb_miss_fka); | ||
195 | ctlr_dev->lesb.lesb_symb_err = | ||
196 | ntohl(fcoe_lesb->lesb_symb_err); | ||
197 | ctlr_dev->lesb.lesb_err_block = | ||
198 | ntohl(fcoe_lesb->lesb_err_block); | ||
199 | ctlr_dev->lesb.lesb_fcs_error = | ||
200 | ntohl(fcoe_lesb->lesb_fcs_error); | ||
201 | } | ||
202 | EXPORT_SYMBOL_GPL(fcoe_ctlr_get_lesb); | ||
203 | |||
150 | void fcoe_wwn_to_str(u64 wwn, char *buf, int len) | 204 | void fcoe_wwn_to_str(u64 wwn, char *buf, int len) |
151 | { | 205 | { |
152 | u8 wwpn[8]; | 206 | u8 wwpn[8]; |