aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa/bfad_im.h
diff options
context:
space:
mode:
authorKrishna Gudipati <kgudipat@brocade.com>2010-09-15 14:50:55 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-09-16 22:54:24 -0400
commita36c61f9025b8924f99f54d518763bee7aa84085 (patch)
treee1d58c382ad31fe1ad3c5f6bccde1b9df1d9fd8c /drivers/scsi/bfa/bfad_im.h
parentedaed859e63aac174fcc3fed81886b91bb124661 (diff)
[SCSI] bfa: cleanup driver
We have flattened the BFA hierarchy and also reduced the number of source and header files we used to have earlier. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/bfa/bfad_im.h')
-rw-r--r--drivers/scsi/bfa/bfad_im.h56
1 files changed, 38 insertions, 18 deletions
diff --git a/drivers/scsi/bfa/bfad_im.h b/drivers/scsi/bfa/bfad_im.h
index 973cab4d09c7..b038c0e08921 100644
--- a/drivers/scsi/bfa/bfad_im.h
+++ b/drivers/scsi/bfa/bfad_im.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2005-2009 Brocade Communications Systems, Inc. 2 * Copyright (c) 2005-2010 Brocade Communications Systems, Inc.
3 * All rights reserved 3 * All rights reserved
4 * www.brocade.com 4 * www.brocade.com
5 * 5 *
@@ -18,20 +18,20 @@
18#ifndef __BFAD_IM_H__ 18#ifndef __BFAD_IM_H__
19#define __BFAD_IM_H__ 19#define __BFAD_IM_H__
20 20
21#include "fcs/bfa_fcs_fcpim.h" 21#include "bfa_fcs.h"
22#include "bfad_im_compat.h"
23 22
24#define FCPI_NAME " fcpim" 23#define FCPI_NAME " fcpim"
25 24
25#ifndef KOBJ_NAME_LEN
26#define KOBJ_NAME_LEN 20
27#endif
28
26bfa_status_t bfad_im_module_init(void); 29bfa_status_t bfad_im_module_init(void);
27void bfad_im_module_exit(void); 30void bfad_im_module_exit(void);
28bfa_status_t bfad_im_probe(struct bfad_s *bfad); 31bfa_status_t bfad_im_probe(struct bfad_s *bfad);
29void bfad_im_probe_undo(struct bfad_s *bfad); 32void bfad_im_probe_undo(struct bfad_s *bfad);
30void bfad_im_probe_post(struct bfad_im_s *im);
31bfa_status_t bfad_im_port_new(struct bfad_s *bfad, struct bfad_port_s *port); 33bfa_status_t bfad_im_port_new(struct bfad_s *bfad, struct bfad_port_s *port);
32void bfad_im_port_delete(struct bfad_s *bfad, struct bfad_port_s *port); 34void bfad_im_port_delete(struct bfad_s *bfad, struct bfad_port_s *port);
33void bfad_im_port_online(struct bfad_s *bfad, struct bfad_port_s *port);
34void bfad_im_port_offline(struct bfad_s *bfad, struct bfad_port_s *port);
35void bfad_im_port_clean(struct bfad_im_port_s *im_port); 35void bfad_im_port_clean(struct bfad_im_port_s *im_port);
36int bfad_im_scsi_host_alloc(struct bfad_s *bfad, 36int bfad_im_scsi_host_alloc(struct bfad_s *bfad,
37 struct bfad_im_port_s *im_port, struct device *dev); 37 struct bfad_im_port_s *im_port, struct device *dev);
@@ -44,14 +44,10 @@ void bfad_im_scsi_host_free(struct bfad_s *bfad,
44#define BFAD_LUN_RESET_TMO 60 44#define BFAD_LUN_RESET_TMO 60
45#define ScsiResult(host_code, scsi_code) (((host_code) << 16) | scsi_code) 45#define ScsiResult(host_code, scsi_code) (((host_code) << 16) | scsi_code)
46#define BFA_QUEUE_FULL_RAMP_UP_TIME 120 46#define BFA_QUEUE_FULL_RAMP_UP_TIME 120
47#define BFAD_KOBJ_NAME_LEN 20
48 47
49/* 48/*
50 * itnim flags 49 * itnim flags
51 */ 50 */
52#define ITNIM_MAPPED 0x00000001
53
54#define SCSI_TASK_MGMT 0x00000001
55#define IO_DONE_BIT 0 51#define IO_DONE_BIT 0
56 52
57struct bfad_itnim_data_s { 53struct bfad_itnim_data_s {
@@ -64,7 +60,7 @@ struct bfad_im_port_s {
64 struct work_struct port_delete_work; 60 struct work_struct port_delete_work;
65 int idr_id; 61 int idr_id;
66 u16 cur_scsi_id; 62 u16 cur_scsi_id;
67 u16 flags; 63 u16 flags;
68 struct list_head binding_list; 64 struct list_head binding_list;
69 struct Scsi_Host *shost; 65 struct Scsi_Host *shost;
70 struct list_head itnim_mapped_list; 66 struct list_head itnim_mapped_list;
@@ -118,14 +114,13 @@ struct bfad_fcp_binding {
118struct bfad_im_s { 114struct bfad_im_s {
119 struct bfad_s *bfad; 115 struct bfad_s *bfad;
120 struct workqueue_struct *drv_workq; 116 struct workqueue_struct *drv_workq;
121 char drv_workq_name[BFAD_KOBJ_NAME_LEN]; 117 char drv_workq_name[KOBJ_NAME_LEN];
122}; 118};
123 119
124struct Scsi_Host *bfad_os_scsi_host_alloc(struct bfad_im_port_s *im_port, 120struct Scsi_Host *bfad_os_scsi_host_alloc(struct bfad_im_port_s *im_port,
125 struct bfad_s *); 121 struct bfad_s *);
126bfa_status_t bfad_os_thread_workq(struct bfad_s *bfad); 122bfa_status_t bfad_os_thread_workq(struct bfad_s *bfad);
127void bfad_os_destroy_workq(struct bfad_im_s *im); 123void bfad_os_destroy_workq(struct bfad_im_s *im);
128void bfad_os_itnim_process(struct bfad_itnim_s *itnim_drv);
129void bfad_os_fc_host_init(struct bfad_im_port_s *im_port); 124void bfad_os_fc_host_init(struct bfad_im_port_s *im_port);
130void bfad_os_scsi_host_free(struct bfad_s *bfad, 125void bfad_os_scsi_host_free(struct bfad_s *bfad,
131 struct bfad_im_port_s *im_port); 126 struct bfad_im_port_s *im_port);
@@ -133,11 +128,6 @@ void bfad_os_ramp_up_qdepth(struct bfad_itnim_s *itnim,
133 struct scsi_device *sdev); 128 struct scsi_device *sdev);
134void bfad_os_handle_qfull(struct bfad_itnim_s *itnim, struct scsi_device *sdev); 129void bfad_os_handle_qfull(struct bfad_itnim_s *itnim, struct scsi_device *sdev);
135struct bfad_itnim_s *bfad_os_get_itnim(struct bfad_im_port_s *im_port, int id); 130struct bfad_itnim_s *bfad_os_get_itnim(struct bfad_im_port_s *im_port, int id);
136int bfad_os_scsi_add_host(struct Scsi_Host *shost,
137 struct bfad_im_port_s *im_port, struct bfad_s *bfad);
138
139void bfad_im_itnim_unmap(struct bfad_im_port_s *im_port,
140 struct bfad_itnim_s *itnim);
141 131
142extern struct scsi_host_template bfad_im_scsi_host_template; 132extern struct scsi_host_template bfad_im_scsi_host_template;
143extern struct scsi_host_template bfad_im_vport_template; 133extern struct scsi_host_template bfad_im_vport_template;
@@ -146,4 +136,34 @@ extern struct fc_function_template bfad_im_vport_fc_function_template;
146extern struct scsi_transport_template *bfad_im_scsi_transport_template; 136extern struct scsi_transport_template *bfad_im_scsi_transport_template;
147extern struct scsi_transport_template *bfad_im_scsi_vport_transport_template; 137extern struct scsi_transport_template *bfad_im_scsi_vport_transport_template;
148 138
139extern struct device_attribute *bfad_im_host_attrs[];
140extern struct device_attribute *bfad_im_vport_attrs[];
141
142irqreturn_t bfad_intx(int irq, void *dev_id);
143
144/* Firmware releated */
145#define BFAD_FW_FILE_CT_FC "ctfw_fc.bin"
146#define BFAD_FW_FILE_CT_CNA "ctfw_cna.bin"
147#define BFAD_FW_FILE_CB_FC "cbfw_fc.bin"
148
149u32 *bfad_get_firmware_buf(struct pci_dev *pdev);
150u32 *bfad_read_firmware(struct pci_dev *pdev, u32 **bfi_image,
151 u32 *bfi_image_size, char *fw_name);
152
153static inline u32 *
154bfad_load_fwimg(struct pci_dev *pdev)
155{
156 return bfad_get_firmware_buf(pdev);
157}
158
159static inline void
160bfad_free_fwimg(void)
161{
162 if (bfi_image_ct_fc_size && bfi_image_ct_fc)
163 vfree(bfi_image_ct_fc);
164 if (bfi_image_ct_cna_size && bfi_image_ct_cna)
165 vfree(bfi_image_ct_cna);
166 if (bfi_image_cb_fc_size && bfi_image_cb_fc)
167 vfree(bfi_image_cb_fc);
168}
149#endif 169#endif