aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/be2iscsi/be_mgmt.c
diff options
context:
space:
mode:
authorJayamohan Kallickal <jayamohank@serverengines.com>2010-07-21 18:59:18 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-08-06 10:41:51 -0400
commitc7acc5b8f9a0e6cb17d313ebfbc5d392aa837ac7 (patch)
tree73f61ea13608fdfb3c96c842e0cdb2e0257a9575 /drivers/scsi/be2iscsi/be_mgmt.c
parentf3506b755f730f199aea3289712f9604ae562319 (diff)
[SCSI] be2iscsi: Add support for iscsi boot
This patch contains changes for adding support for iscsi_boot. Have modified to make read of mac address from chip as a function. The mac_address is being cached after teh first call as it is not expected to change Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/be2iscsi/be_mgmt.c')
-rw-r--r--drivers/scsi/be2iscsi/be_mgmt.c71
1 files changed, 71 insertions, 0 deletions
diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c
index 3f3fab91a7d1..26350e470bcc 100644
--- a/drivers/scsi/be2iscsi/be_mgmt.c
+++ b/drivers/scsi/be2iscsi/be_mgmt.c
@@ -20,6 +20,77 @@
20 20
21#include "be_mgmt.h" 21#include "be_mgmt.h"
22#include "be_iscsi.h" 22#include "be_iscsi.h"
23#include <scsi/scsi_transport_iscsi.h>
24
25unsigned int beiscsi_get_boot_target(struct beiscsi_hba *phba)
26{
27 struct be_ctrl_info *ctrl = &phba->ctrl;
28 struct be_mcc_wrb *wrb;
29 struct be_cmd_req_get_mac_addr *req;
30 unsigned int tag = 0;
31
32 SE_DEBUG(DBG_LVL_8, "In bescsi_get_boot_target\n");
33 spin_lock(&ctrl->mbox_lock);
34 tag = alloc_mcc_tag(phba);
35 if (!tag) {
36 spin_unlock(&ctrl->mbox_lock);
37 return tag;
38 }
39
40 wrb = wrb_from_mccq(phba);
41 req = embedded_payload(wrb);
42 wrb->tag0 |= tag;
43 be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0);
44 be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ISCSI_INI,
45 OPCODE_ISCSI_INI_BOOT_GET_BOOT_TARGET,
46 sizeof(*req));
47
48 be_mcc_notify(phba);
49 spin_unlock(&ctrl->mbox_lock);
50 return tag;
51}
52
53unsigned int beiscsi_get_session_info(struct beiscsi_hba *phba,
54 u32 boot_session_handle,
55 struct be_dma_mem *nonemb_cmd)
56{
57 struct be_ctrl_info *ctrl = &phba->ctrl;
58 struct be_mcc_wrb *wrb;
59 unsigned int tag = 0;
60 struct be_cmd_req_get_session *req;
61 struct be_cmd_resp_get_session *resp;
62 struct be_sge *sge;
63
64 SE_DEBUG(DBG_LVL_8, "In beiscsi_get_session_info\n");
65 spin_lock(&ctrl->mbox_lock);
66 tag = alloc_mcc_tag(phba);
67 if (!tag) {
68 spin_unlock(&ctrl->mbox_lock);
69 return tag;
70 }
71
72 nonemb_cmd->size = sizeof(*resp);
73 req = nonemb_cmd->va;
74 memset(req, 0, sizeof(*req));
75 wrb = wrb_from_mccq(phba);
76 sge = nonembedded_sgl(wrb);
77 wrb->tag0 |= tag;
78
79
80 wrb->tag0 |= tag;
81 be_wrb_hdr_prepare(wrb, sizeof(*req), false, 1);
82 be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ISCSI_INI,
83 OPCODE_ISCSI_INI_SESSION_GET_A_SESSION,
84 sizeof(*resp));
85 req->session_handle = boot_session_handle;
86 sge->pa_hi = cpu_to_le32(upper_32_bits(nonemb_cmd->dma));
87 sge->pa_lo = cpu_to_le32(nonemb_cmd->dma & 0xFFFFFFFF);
88 sge->len = cpu_to_le32(nonemb_cmd->size);
89
90 be_mcc_notify(phba);
91 spin_unlock(&ctrl->mbox_lock);
92 return tag;
93}
23 94
24int mgmt_get_fw_config(struct be_ctrl_info *ctrl, 95int mgmt_get_fw_config(struct be_ctrl_info *ctrl,
25 struct beiscsi_hba *phba) 96 struct beiscsi_hba *phba)