diff options
author | Yi Zou <yi.zou@intel.com> | 2012-12-06 01:24:59 -0500 |
---|---|---|
committer | Robert Love <robert.w.love@intel.com> | 2012-12-14 13:38:56 -0500 |
commit | b8b3e697d15165090583bed850879b1f3b250db0 (patch) | |
tree | 012bb47be0dfa02be07d5e552c23e6fc17007fb6 | |
parent | 0e0f9cd6a80dc883dab4c82c17edc1abe485cbd9 (diff) |
bnx2fc: use fcoe_get_lesb/fcoe_ctlr_get_lesb() directly from libfcoe
Drop the bnx2fc_xxx versions as they are basically the same.
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>
-rw-r--r-- | drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 53 |
1 files changed, 7 insertions, 46 deletions
diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c index a1c687c699ee..4d5c72159346 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c +++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c | |||
@@ -93,7 +93,6 @@ static void bnx2fc_port_shutdown(struct fc_lport *lport); | |||
93 | static void bnx2fc_stop(struct bnx2fc_interface *interface); | 93 | static void bnx2fc_stop(struct bnx2fc_interface *interface); |
94 | static int __init bnx2fc_mod_init(void); | 94 | static int __init bnx2fc_mod_init(void); |
95 | static void __exit bnx2fc_mod_exit(void); | 95 | static void __exit bnx2fc_mod_exit(void); |
96 | static void bnx2fc_ctlr_get_lesb(struct fcoe_ctlr_device *ctlr_dev); | ||
97 | 96 | ||
98 | unsigned int bnx2fc_debug_level; | 97 | unsigned int bnx2fc_debug_level; |
99 | module_param_named(debug_logging, bnx2fc_debug_level, int, S_IRUGO|S_IWUSR); | 98 | module_param_named(debug_logging, bnx2fc_debug_level, int, S_IRUGO|S_IWUSR); |
@@ -111,44 +110,6 @@ static inline struct net_device *bnx2fc_netdev(const struct fc_lport *lport) | |||
111 | ((struct fcoe_port *)lport_priv(lport))->priv)->netdev; | 110 | ((struct fcoe_port *)lport_priv(lport))->priv)->netdev; |
112 | } | 111 | } |
113 | 112 | ||
114 | /** | ||
115 | * bnx2fc_get_lesb() - Fill the FCoE Link Error Status Block | ||
116 | * @lport: the local port | ||
117 | * @fc_lesb: the link error status block | ||
118 | */ | ||
119 | static void bnx2fc_get_lesb(struct fc_lport *lport, | ||
120 | struct fc_els_lesb *fc_lesb) | ||
121 | { | ||
122 | struct net_device *netdev = fcoe_get_netdev(lport); | ||
123 | |||
124 | __fcoe_get_lesb(lport, fc_lesb, netdev); | ||
125 | } | ||
126 | |||
127 | static void bnx2fc_ctlr_get_lesb(struct fcoe_ctlr_device *ctlr_dev) | ||
128 | { | ||
129 | struct fcoe_ctlr *fip = fcoe_ctlr_device_priv(ctlr_dev); | ||
130 | struct net_device *netdev = fcoe_get_netdev(fip->lp); | ||
131 | struct fcoe_fc_els_lesb *fcoe_lesb; | ||
132 | struct fc_els_lesb fc_lesb; | ||
133 | |||
134 | __fcoe_get_lesb(fip->lp, &fc_lesb, netdev); | ||
135 | fcoe_lesb = (struct fcoe_fc_els_lesb *)(&fc_lesb); | ||
136 | |||
137 | ctlr_dev->lesb.lesb_link_fail = | ||
138 | ntohl(fcoe_lesb->lesb_link_fail); | ||
139 | ctlr_dev->lesb.lesb_vlink_fail = | ||
140 | ntohl(fcoe_lesb->lesb_vlink_fail); | ||
141 | ctlr_dev->lesb.lesb_miss_fka = | ||
142 | ntohl(fcoe_lesb->lesb_miss_fka); | ||
143 | ctlr_dev->lesb.lesb_symb_err = | ||
144 | ntohl(fcoe_lesb->lesb_symb_err); | ||
145 | ctlr_dev->lesb.lesb_err_block = | ||
146 | ntohl(fcoe_lesb->lesb_err_block); | ||
147 | ctlr_dev->lesb.lesb_fcs_error = | ||
148 | ntohl(fcoe_lesb->lesb_fcs_error); | ||
149 | } | ||
150 | EXPORT_SYMBOL(bnx2fc_ctlr_get_lesb); | ||
151 | |||
152 | static void bnx2fc_fcf_get_vlan_id(struct fcoe_fcf_device *fcf_dev) | 113 | static void bnx2fc_fcf_get_vlan_id(struct fcoe_fcf_device *fcf_dev) |
153 | { | 114 | { |
154 | struct fcoe_ctlr_device *ctlr_dev = | 115 | struct fcoe_ctlr_device *ctlr_dev = |
@@ -2637,12 +2598,12 @@ module_exit(bnx2fc_mod_exit); | |||
2637 | 2598 | ||
2638 | static struct fcoe_sysfs_function_template bnx2fc_fcoe_sysfs_templ = { | 2599 | static struct fcoe_sysfs_function_template bnx2fc_fcoe_sysfs_templ = { |
2639 | .set_fcoe_ctlr_enabled = bnx2fc_ctlr_enabled, | 2600 | .set_fcoe_ctlr_enabled = bnx2fc_ctlr_enabled, |
2640 | .get_fcoe_ctlr_link_fail = bnx2fc_ctlr_get_lesb, | 2601 | .get_fcoe_ctlr_link_fail = fcoe_ctlr_get_lesb, |
2641 | .get_fcoe_ctlr_vlink_fail = bnx2fc_ctlr_get_lesb, | 2602 | .get_fcoe_ctlr_vlink_fail = fcoe_ctlr_get_lesb, |
2642 | .get_fcoe_ctlr_miss_fka = bnx2fc_ctlr_get_lesb, | 2603 | .get_fcoe_ctlr_miss_fka = fcoe_ctlr_get_lesb, |
2643 | .get_fcoe_ctlr_symb_err = bnx2fc_ctlr_get_lesb, | 2604 | .get_fcoe_ctlr_symb_err = fcoe_ctlr_get_lesb, |
2644 | .get_fcoe_ctlr_err_block = bnx2fc_ctlr_get_lesb, | 2605 | .get_fcoe_ctlr_err_block = fcoe_ctlr_get_lesb, |
2645 | .get_fcoe_ctlr_fcs_error = bnx2fc_ctlr_get_lesb, | 2606 | .get_fcoe_ctlr_fcs_error = fcoe_ctlr_get_lesb, |
2646 | 2607 | ||
2647 | .get_fcoe_fcf_selected = fcoe_fcf_get_selected, | 2608 | .get_fcoe_fcf_selected = fcoe_fcf_get_selected, |
2648 | .get_fcoe_fcf_vlan_id = bnx2fc_fcf_get_vlan_id, | 2609 | .get_fcoe_fcf_vlan_id = bnx2fc_fcf_get_vlan_id, |
@@ -2749,7 +2710,7 @@ static struct libfc_function_template bnx2fc_libfc_fcn_templ = { | |||
2749 | .elsct_send = bnx2fc_elsct_send, | 2710 | .elsct_send = bnx2fc_elsct_send, |
2750 | .fcp_abort_io = bnx2fc_abort_io, | 2711 | .fcp_abort_io = bnx2fc_abort_io, |
2751 | .fcp_cleanup = bnx2fc_cleanup, | 2712 | .fcp_cleanup = bnx2fc_cleanup, |
2752 | .get_lesb = bnx2fc_get_lesb, | 2713 | .get_lesb = fcoe_get_lesb, |
2753 | .rport_event_callback = bnx2fc_rport_event_handler, | 2714 | .rport_event_callback = bnx2fc_rport_event_handler, |
2754 | }; | 2715 | }; |
2755 | 2716 | ||