aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/be2iscsi/be_mgmt.c
diff options
context:
space:
mode:
authorJohn Soni Jose <sony.john-n@emulex.com>2012-08-20 13:30:43 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-09-14 12:59:27 -0400
commit6f72238e774742f618ba0332b76b1860762a40cb (patch)
treec3f702662a58859b2c357e24593a4517bb019bc1 /drivers/scsi/be2iscsi/be_mgmt.c
parentdf5d0e6ee9d68f874959fa028388efa26f495f63 (diff)
[SCSI] be2iscsi: Add support for configuring the VLAN on the adapter.
Add support for configuring the VLAN parameters on the adapter using the iscsiadm interface. Signed-off-by: John Soni Jose <sony.john-n@emulex.com> Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/be2iscsi/be_mgmt.c')
-rw-r--r--drivers/scsi/be2iscsi/be_mgmt.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c
index 3dca332acce2..aab5dd359e2c 100644
--- a/drivers/scsi/be2iscsi/be_mgmt.c
+++ b/drivers/scsi/be2iscsi/be_mgmt.c
@@ -1090,3 +1090,49 @@ int be_mgmt_get_boot_shandle(struct beiscsi_hba *phba,
1090 "BG_%d : Login to Boot Target Failed\n"); 1090 "BG_%d : Login to Boot Target Failed\n");
1091 return -ENXIO; 1091 return -ENXIO;
1092} 1092}
1093
1094/**
1095 * mgmt_set_vlan()- Issue and wait for CMD completion
1096 * @phba: device private structure instance
1097 * @vlan_tag: VLAN tag
1098 *
1099 * Issue the MBX Cmd and wait for the completion of the
1100 * command.
1101 *
1102 * returns
1103 * Success: 0
1104 * Failure: Non-Xero Value
1105 **/
1106int mgmt_set_vlan(struct beiscsi_hba *phba,
1107 uint16_t vlan_tag)
1108{
1109 unsigned int tag, wrb_num;
1110 unsigned short status, extd_status;
1111
1112 tag = be_cmd_set_vlan(phba, vlan_tag);
1113 if (!tag) {
1114 beiscsi_log(phba, KERN_ERR,
1115 (BEISCSI_LOG_CONFIG | BEISCSI_LOG_MBOX),
1116 "BG_%d : VLAN Setting Failed\n");
1117 return -EBUSY;
1118 } else
1119 wait_event_interruptible(phba->ctrl.mcc_wait[tag],
1120 phba->ctrl.mcc_numtag[tag]);
1121
1122 wrb_num = (phba->ctrl.mcc_numtag[tag] & 0x00FF0000) >> 16;
1123 extd_status = (phba->ctrl.mcc_numtag[tag] & 0x0000FF00) >> 8;
1124 status = phba->ctrl.mcc_numtag[tag] & 0x000000FF;
1125
1126 if (status || extd_status) {
1127 beiscsi_log(phba, KERN_ERR,
1128 (BEISCSI_LOG_CONFIG | BEISCSI_LOG_MBOX),
1129 "BS_%d : status : %d extd_status : %d\n",
1130 status, extd_status);
1131
1132 free_mcc_tag(&phba->ctrl, tag);
1133 return -EAGAIN;
1134 }
1135
1136 free_mcc_tag(&phba->ctrl, tag);
1137 return 0;
1138}