bfa: Brocade BFA FC SCSI driver submission
Subsystems (2)
PATCH 2/5 bfa: Brocade BFA FC SCSI driver submission
From: Jing Huang <[email protected]>
This patch contains code that interfaces to Brocade Fibre channel HBA firmware/hardware. It is created using 2.6.29-rc2 kernel.
--- drivers/scsi/bfa/bfa_callback_priv.h | 57 + drivers/scsi/bfa/bfa_cb_ioim_macros.h | 213 ++++ drivers/scsi/bfa/bfa_core.c | 408 ++++++++ drivers/scsi/bfa/bfa_core.o |binary drivers/scsi/bfa/bfa_csdebug.c | 55 + drivers/scsi/bfa/bfa_csdebug.o |binary drivers/scsi/bfa/bfa_fcpim.c | 152 +++ drivers/scsi/bfa/bfa_fcpim.o |binary drivers/scsi/bfa/bfa_fcpim_priv.h | 213 ++++ drivers/scsi/bfa/bfa_fcs.c | 250 +++++ drivers/scsi/bfa/bfa_fcs.o |binary drivers/scsi/bfa/bfa_fcxp.c | 713 ++++++++++++++ drivers/scsi/bfa/bfa_fcxp.o |binary drivers/scsi/bfa/bfa_fcxp_priv.h | 135 ++ drivers/scsi/bfa/bfa_fwimg_priv.h | 26 drivers/scsi/bfa/bfa_hw_cb.c | 60 + drivers/scsi/bfa/bfa_hw_cb.o |binary drivers/scsi/bfa/bfa_hw_ct.c | 66 + drivers/scsi/bfa/bfa_hw_ct.o |binary drivers/scsi/bfa/bfa_intr.c | 287 +++++ drivers/scsi/bfa/bfa_intr.o |binary drivers/scsi/bfa/bfa_intr_priv.h | 118 ++ drivers/scsi/bfa/bfa_ioc.c | 1553 ++++++++++++++++++++++++++++++++ drivers/scsi/bfa/bfa_ioc.h | 193 +++ drivers/scsi/bfa/bfa_ioc.o |binary drivers/scsi/bfa/bfa_iocfc.c | 834 +++++++++++++++++ drivers/scsi/bfa/bfa_iocfc.h | 113 ++ drivers/scsi/bfa/bfa_iocfc.o |binary drivers/scsi/bfa/bfa_ioim.c | 1290 ++++++++++++++++++++++++++ drivers/scsi/bfa/bfa_ioim.o |binary drivers/scsi/bfa/bfa_itnim.c | 969 ++++++++++++++++++++ drivers/scsi/bfa/bfa_itnim.o |binary drivers/scsi/bfa/bfa_log.c | 344 +++++++ drivers/scsi/bfa/bfa_log.o |binary drivers/scsi/bfa/bfa_log_module.c | 421 ++++++++ drivers/scsi/bfa/bfa_log_module.o |binary drivers/scsi/bfa/bfa_module.c | 62 + drivers/scsi/bfa/bfa_module.o |binary drivers/scsi/bfa/bfa_modules_priv.h | 36 drivers/scsi/bfa/bfa_os_inc.h | 195 ++++ drivers/scsi/bfa/bfa_port.c | 1643 ++++++++++++++++++++++++++++++++++ drivers/scsi/bfa/bfa_port.o |binary drivers/scsi/bfa/bfa_port_priv.h | 89 + drivers/scsi/bfa/bfa_priv.h | 108 ++ drivers/scsi/bfa/bfa_rport.c | 790 ++++++++++++++++ drivers/scsi/bfa/bfa_rport.o |binary drivers/scsi/bfa/bfa_rport_priv.h | 45 drivers/scsi/bfa/bfa_sgpg.c | 231 ++++ drivers/scsi/bfa/bfa_sgpg.o |binary drivers/scsi/bfa/bfa_sgpg_priv.h | 79 + drivers/scsi/bfa/bfa_sm.c | 38 drivers/scsi/bfa/bfa_sm.o |binary drivers/scsi/bfa/bfa_timer.c | 90 + drivers/scsi/bfa/bfa_timer.o |binary drivers/scsi/bfa/bfa_trcmod_priv.h | 58 + drivers/scsi/bfa/bfa_tskim.c | 689 ++++++++++++++ drivers/scsi/bfa/bfa_tskim.o |binary drivers/scsi/bfa/bfa_uf.c | 339 +++++++ drivers/scsi/bfa/bfa_uf.o |binary drivers/scsi/bfa/bfa_uf_priv.h | 47 drivers/scsi/bfa/plog.c | 183 +++ 61 files changed, 13192 insertions(+)
drivers/scsi/bfa/bfa_callback_priv.h +57 -0
@@ -0,0 +1,57 @@ +/* +* Copyright (c) 2005-2008 Brocade Communications Systems, Inc. +* All rights reserved +* www.brocade.com +* +* Linux driver for Brocade Fibre Channel Host Bus Adapter. +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License (GPL) Version 2 as +* published by the Free Software Foundation +* +* This program is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* General Public License for more details. +*/ + +#ifndef __HAL_CALLBACK_H__ +#define __HAL_CALLBACK_H__ + +#include <cs/bfa_q.h> + +typedef void (*bfa_cb_cbfn_t ) (void *cbarg,bfa_boolean_t complete); + +/** +* Generic HAL callback element. +*/ +struct bfa_cb_qe_s { +struct bfa_q_s qe; +bfa_cb_cbfn_t cbfn; +bfa_boolean_t once; +u32 rsvd; +void *cbarg; +}; + +#define bfa_cb_queue (__bfa, __hcb_qe, __cbfn, __cbarg) do { \ + (__hcb_qe)->cbfn = (__cbfn); \ + (__hcb_qe)->cbarg = (__cbarg); \ + bfa_q_enq(&(__bfa)->comp_q, (__hcb_qe)); \ +} while (0) + +#define bfa_cb_dequeue (__hcb_qe) bfa_q_qe_deq(__hcb_qe) + +#define bfa_cb_queue_once (__bfa, __hcb_qe, __cbfn, __cbarg) do { \ + (__hcb_qe)->cbfn = (__cbfn); \ + (__hcb_qe)->cbarg = (__cbarg); \ + if (!(__hcb_qe)->once) { \ + bfa_q_enq(&(__bfa)->comp_q, (__hcb_qe)); \ + (__hcb_qe)->once = BFA_TRUE; \ + } \ +} while (0) + +#define bfa_cb_queue_done (__hcb_qe) do { \ + (__hcb_qe)->once = BFA_FALSE; \ +} while (0) + +#endif /* __HAL_CALLBACK_H__ */
drivers/scsi/bfa/bfa_cb_ioim_macros.h +213 -0
213 lines not on this page · raw message
drivers/scsi/bfa/bfa_core.c +408 -0
408 lines not on this page · raw message
Binary files orig/drivers/scsi/bfa/bfa_core.o and patch/drivers/scsi/bfa/bfa_core.o differ
drivers/scsi/bfa/bfa_csdebug.c +55 -0
55 lines not on this page · raw message
Binary files orig/drivers/scsi/bfa/bfa_csdebug.o and patch/drivers/scsi/bfa/bfa_csdebug.o differ
drivers/scsi/bfa/bfa_fcpim.c +152 -0
152 lines not on this page · raw message
Binary files orig/drivers/scsi/bfa/bfa_fcpim.o and patch/drivers/scsi/bfa/bfa_fcpim.o differ
drivers/scsi/bfa/bfa_fcpim_priv.h +213 -0
213 lines not on this page · raw message
drivers/scsi/bfa/bfa_fcs.c +250 -0
250 lines not on this page · raw message
Binary files orig/drivers/scsi/bfa/bfa_fcs.o and patch/drivers/scsi/bfa/bfa_fcs.o differ
drivers/scsi/bfa/bfa_fcxp.c +713 -0
713 lines not on this page · raw message
Binary files orig/drivers/scsi/bfa/bfa_fcxp.o and patch/drivers/scsi/bfa/bfa_fcxp.o differ
drivers/scsi/bfa/bfa_fcxp_priv.h +135 -0
135 lines not on this page · raw message
drivers/scsi/bfa/bfa_fwimg_priv.h +26 -0
@@ -0,0 +1,26 @@ +/* +* Copyright (c) 2005-2008 Brocade Communications Systems, Inc. +* All rights reserved +* www.brocade.com +* +* Linux driver for Brocade Fibre Channel Host Bus Adapter. +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License (GPL) Version 2 as +* published by the Free Software Foundation +* +* This program is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* General Public License for more details. +*/ + +#ifndef __HAL_FWIMG_H__ +#define __HAL_FWIMG_H__ + +extern u32 *bfi_image; +extern u32 bfi_image_size; +extern u32 *bfad_fwimg_buf; +extern char __bfa_ident[]; + +#endif /* __HAL_FWIMG_H__ */
drivers/scsi/bfa/bfa_hw_cb.c +60 -0
60 lines not on this page · raw message
Binary files orig/drivers/scsi/bfa/bfa_hw_cb.o and patch/drivers/scsi/bfa/bfa_hw_cb.o differ
drivers/scsi/bfa/bfa_hw_ct.c +66 -0
66 lines not on this page · raw message
Binary files orig/drivers/scsi/bfa/bfa_hw_ct.o and patch/drivers/scsi/bfa/bfa_hw_ct.o differ
drivers/scsi/bfa/bfa_intr.c +287 -0
287 lines not on this page · raw message
Binary files orig/drivers/scsi/bfa/bfa_intr.o and patch/drivers/scsi/bfa/bfa_intr.o differ
drivers/scsi/bfa/bfa_intr_priv.h +118 -0
118 lines not on this page · raw message
drivers/scsi/bfa/bfa_ioc.c +1553 -0
247 lines not on this page · raw message
drivers/scsi/bfa/bfa_iocfc.c +834 -0
834 lines not on this page · raw message
drivers/scsi/bfa/bfa_iocfc.h +113 -0
113 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Binary files orig/drivers/scsi/bfa/bfa_iocfc.o and patch/drivers/scsi/bfa/bfa_iocfc.o differ
drivers/scsi/bfa/bfa_ioc.h +193 -0
193 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Binary files orig/drivers/scsi/bfa/bfa_ioc.o and patch/drivers/scsi/bfa/bfa_ioc.o differ
drivers/scsi/bfa/bfa_ioim.c +1290 -0
1,290 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Binary files orig/drivers/scsi/bfa/bfa_ioim.o and patch/drivers/scsi/bfa/bfa_ioim.o differ
drivers/scsi/bfa/bfa_itnim.c +969 -0
969 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Binary files orig/drivers/scsi/bfa/bfa_itnim.o and patch/drivers/scsi/bfa/bfa_itnim.o differ
drivers/scsi/bfa/bfa_log.c +344 -0
344 lines not on this page · raw message
drivers/scsi/bfa/bfa_log_module.c +421 -0
421 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Binary files orig/drivers/scsi/bfa/bfa_log_module.o and patch/drivers/scsi/bfa/bfa_log_module.o differ Binary files orig/drivers/scsi/bfa/bfa_log.o and patch/drivers/scsi/bfa/bfa_log.o differ
drivers/scsi/bfa/bfa_module.c +62 -0
62 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Binary files orig/drivers/scsi/bfa/bfa_module.o and patch/drivers/scsi/bfa/bfa_module.o differ
drivers/scsi/bfa/bfa_os_inc.h +195 -0
195 lines not on this page · raw message
drivers/scsi/bfa/bfa_port.c +1643 -0
1,643 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Binary files orig/drivers/scsi/bfa/bfa_port.o and patch/drivers/scsi/bfa/bfa_port.o differ
drivers/scsi/bfa/bfa_port_priv.h +89 -0
89 lines not on this page · raw message
drivers/scsi/bfa/bfa_priv.h +108 -0
108 lines not on this page · raw message
drivers/scsi/bfa/bfa_rport.c +790 -0
790 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Binary files orig/drivers/scsi/bfa/bfa_rport.o and patch/drivers/scsi/bfa/bfa_rport.o differ
drivers/scsi/bfa/bfa_rport_priv.h +45 -0
45 lines not on this page · raw message
drivers/scsi/bfa/bfa_sgpg.c +231 -0
231 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Binary files orig/drivers/scsi/bfa/bfa_sgpg.o and patch/drivers/scsi/bfa/bfa_sgpg.o differ
drivers/scsi/bfa/bfa_sgpg_priv.h +79 -0
79 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Binary files orig/drivers/scsi/bfa/bfa_sm.o and patch/drivers/scsi/bfa/bfa_sm.o differ
drivers/scsi/bfa/bfa_timer.c +90 -0
90 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Binary files orig/drivers/scsi/bfa/bfa_timer.o and patch/drivers/scsi/bfa/bfa_timer.o differ
drivers/scsi/bfa/bfa_trcmod_priv.h +58 -0
58 lines not on this page · raw message
drivers/scsi/bfa/bfa_tskim.c +689 -0
689 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Binary files orig/drivers/scsi/bfa/bfa_tskim.o and patch/drivers/scsi/bfa/bfa_tskim.o differ
drivers/scsi/bfa/bfa_uf.c +339 -0
339 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Binary files orig/drivers/scsi/bfa/bfa_uf.o and patch/drivers/scsi/bfa/bfa_uf.o differ
drivers/scsi/bfa/bfa_uf_priv.h +47 -0
47 lines not on this page · raw message
drivers/scsi/bfa/plog.c +183 -0
183 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
Quoted 6 lines · Jing Huang
drivers/scsi/bfa/bfa_callback_priv.h +6
-0+/** +* Generic HAL callback element. +*/ +struct bfa_cb_qe_s { +struct bfa_q_s qe; +bfa_cb_cbfn_t cbfn;
drivers/scsi/bfa/bfa_callback_priv.h line 40
Quoted 10 lines
drivers/scsi/bfa/bfa_callback_priv.h +10
-0+bfa_boolean_t once; +u32 rsvd; +void *cbarg; +}; + +#define bfa_cb_queue (__bfa, __hcb_qe, __cbfn, __cbarg) do { \ + (__hcb_qe)->cbfn = (__cbfn); \ + (__hcb_qe)->cbarg = (__cbarg); \ + bfa_q_enq(&(__bfa)->comp_q, (__hcb_qe)); \ +} while (0)
Please stop here, weird HALs and own list management routines are not things we put into the tree. (except for gregs junk subdirectory..)
Please rewrite this into a proper Linux driver.
Quoted 12 lines
-----Original Message-----
From: Christoph Hellwig [mailto:[email protected]]
Sent: Tuesday, January 27, 2009 2:16 PM
To: Jing Huang
Cc: [email protected]; Krishna Gudipati; linux- [email protected]; [email protected]; Ramkumar Vadivelu; Vinodh Ravindran
Subject: Re: [PATCH 2/5] bfa: Brocade BFA FC SCSI driver submissionOn Tue, Jan 27, 2009 at 10:54:07AM -0800, Jing Huang wrote:
Quoted 12 lines
drivers/scsi/bfa/bfa_callback_priv.h
Quoted 12 lines
drivers/scsi/bfa/bfa_callback_priv.h +12
-0+/** +* Generic HAL callback element. +*/ +struct bfa_cb_qe_s { +struct bfa_q_s qe; +bfa_cb_cbfn_t cbfn; +bfa_boolean_t once; +u32 rsvd; +void *cbarg; +}; + +#define bfa_cb_queue (__bfa, __hcb_qe, __cbfn, __cbarg) do {
\
Quoted 1 line
Review
Quoted 1 line
(quoted diff) +1
-0+ (__hcb_qe)->cbfn = (__cbfn);
\
Quoted 1 line
Review
Quoted 1 line
(quoted diff) +1
-0+ (__hcb_qe)->cbarg = (__cbarg);
\
Quoted 1 line
Review
Quoted 1 line
(quoted diff) +1
-0+ bfa_q_enq(&(__bfa)->comp_q, (__hcb_qe));
\
Quoted 6 lines
Quoted 1 line
+} while (0)
Please stop here, weird HALs and own list management routines are not things we put into the tree. (except for gregs junk subdirectory..)
Please rewrite this into a proper Linux driver.
Thanks Christoph for the code review,
I will clean up all the HAL references and also replace our own list management code with standard linux implementation.
Jing
James Bottomley
maintainerQuoted 35 lines · Jing Huang
Quoted 11 lines
-----Original Message-----
From: Christoph Hellwig [mailto:[email protected]]
Sent: Tuesday, January 27, 2009 2:16 PM
To: Jing Huang
Cc: [email protected]; Krishna Gudipati; linux- [email protected]; [email protected]; Ramkumar Vadivelu; Vinodh Ravindran
Subject: Re: [PATCH 2/5] bfa: Brocade BFA FC SCSI driver submissionOn Tue, Jan 27, 2009 at 10:54:07AM -0800, Jing Huang wrote:
Quoted 12 lines
drivers/scsi/bfa/bfa_callback_priv.h
Quoted 12 lines
drivers/scsi/bfa/bfa_callback_priv.h +12
-0+/** +* Generic HAL callback element. +*/ +struct bfa_cb_qe_s { +struct bfa_q_s qe; +bfa_cb_cbfn_t cbfn; +bfa_boolean_t once; +u32 rsvd; +void *cbarg; +}; + +#define bfa_cb_queue (__bfa, __hcb_qe, __cbfn, __cbarg) do {\
Quoted 1 line
Review
Quoted 1 line
(quoted diff) +1
-0+ (__hcb_qe)->cbfn = (__cbfn);\
Quoted 1 line
Review
Quoted 1 line
(quoted diff) +1
-0+ (__hcb_qe)->cbarg = (__cbarg);\
Quoted 1 line
Review
Quoted 1 line
(quoted diff) +1
-0+ bfa_q_enq(&(__bfa)->comp_q, (__hcb_qe));\
Quoted 5 lines
Quoted 1 line
+} while (0)
Please stop here, weird HALs and own list management routines are not things we put into the tree. (except for gregs junk subdirectory..)
Quoted 7 lines
Quoted 1 line
Please rewrite this into a proper Linux driver.
Thanks Christoph for the code review,
I will clean up all the HAL references and also replace our own list management code with standard linux implementation.
This might take a while. I can offer to put this driver in the staging tree while you work on it if that would be helpful?
The way the staging tree works is that drivers are held in a separate area (drivers/staging) in the linux kernel while they're being worked on. The driver can be installed by users while it's in the staging tree (so made use of) but it will taint the kernel with a warning that it's not of linux kernel quality yet. Once we get an acceptable driver in drivers/staging, I'll move it across to drivers/scsi and remove the taint.
James
James Bottomley Wrote:
Quoted 14 lines
Quoted 14 lines
Quoted 11 lines
drivers/scsi/bfa/bfa_callback_priv.h
Quoted 11 lines
+ * Generic HAL callback element.
+ */drivers/scsi/bfa/bfa_callback_priv.h +9
-0+struct bfa_cb_qe_s { +struct bfa_q_s qe; +bfa_cb_cbfn_t cbfn; +bfa_boolean_t once; +u32 rsvd; +void *cbarg; +}; + +#define bfa_cb_queue (__bfa, __hcb_qe, __cbfn, __cbarg) do {\
Quoted 1 line
Review
Quoted 1 line
(quoted diff) +1
-0+ (__hcb_qe)->cbfn = (__cbfn);\
Quoted 7 lines
Quoted 7 lines
Quoted 1 line
Review
Quoted 1 line
(quoted diff) +1
-0+ (__hcb_qe)->cbarg = (__cbarg);\
Quoted 1 line
Review
Quoted 1 line
(quoted diff) +1
-0+ bfa_q_enq(&(__bfa)->comp_q, (__hcb_qe));\
Quoted 3 lines
Quoted 1 line
+} while (0)
Please stop here, weird HALs and own list management routines are
not
Quoted 1 line
Quoted 1 line
Quoted 1 line
things we put into the tree. (except for gregs junk
subdirectory..)
Quoted 10 lines
Quoted 8 lines
Quoted 2 lines
Please rewrite this into a proper Linux driver.
Thanks Christoph for the code review,
I will clean up all the HAL references and also replace our own list management code with standard linux implementation.
This might take a while. I can offer to put this driver in the
staging
Quoted 5 lines
tree while you work on it if that would be helpful?
The way the staging tree works is that drivers are held in a separate area (
drivers/staging) in the linux kernel while they're being worked on. The driver can be installed by users while it's in the staging
tree
Quoted 8 lines
(so made use of) but it will taint the kernel with a warning that it's not of linux kernel quality yet. Once we get an acceptable driver in
drivers/staging, I'll move it across todrivers/scsiand remove the taint.James
This is definitely helpful, thanks James!
Jing
Quoted 11 lines · Jing Huang
Quoted 11 lines
This might take a while. I can offer to put this driver in the staging tree while you work on it if that would be helpful?
The way the staging tree works is that drivers are held in a separate area (
drivers/staging) in the linux kernel while they're being worked on. The driver can be installed by users while it's in the staging tree (so made use of) but it will taint the kernel with a warning that it's not of linux kernel quality yet. Once we get an acceptable driver indrivers/staging, I'll move it across todrivers/scsiand remove the taint.
Quoted 5 lines
Quoted 3 lines
James
This is definitely helpful, thanks James!
Does this mean someone will send me a patch to add this to the drivers/staging/ tree? Or should I just grab these patches and use them to add them to the tree myself (preserving author attributes of course)?
thanks,
greg k-h
Greg KH Wrote:
Quoted 5 lines
Quoted 2 lines
This is definitely helpful, thanks James!
Does this mean someone will send me a patch to add this to the
drivers/staging/tree? Or should I just grab these patches and use
them
Quoted 1 line
to add them to the tree myself (preserving author attributes of
course)?
Quoted 4 lines
thanks,
greg k-h
Hi Greg,
Can you hold on adding this driver to driver/staging for a few weeks? The driver I just submitted does compile and load but some important features are not completed. We are still actively working on moving some code to firmware to make it simpler and easier for code review. We expect to get this done in next 2 or 3 weeks, at that time, we will submit a complete driver which include the above mentioned change, and all the code review comments we received in this submission.
Thanks!
Jing
Quoted 1 line · Jing Huang
Can you hold on adding this driver to driver/staging for a few weeks?
Sure, just resend it when you feel it is ready to go into staging.
thanks,
greg k-h