aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/be2iscsi/be_cmds.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_cmds.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_cmds.c')
-rw-r--r--drivers/scsi/be2iscsi/be_cmds.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/drivers/scsi/be2iscsi/be_cmds.c b/drivers/scsi/be2iscsi/be_cmds.c
index d0058e38bc62..07d2cb126d93 100644
--- a/drivers/scsi/be2iscsi/be_cmds.c
+++ b/drivers/scsi/be2iscsi/be_cmds.c
@@ -934,3 +934,45 @@ int beiscsi_cmd_reset_function(struct beiscsi_hba *phba)
934 spin_unlock(&ctrl->mbox_lock); 934 spin_unlock(&ctrl->mbox_lock);
935 return status; 935 return status;
936} 936}
937
938/**
939 * be_cmd_set_vlan()- Configure VLAN paramters on the adapter
940 * @phba: device priv structure instance
941 * @vlan_tag: TAG to be set
942 *
943 * Set the VLAN_TAG for the adapter or Disable VLAN on adapter
944 *
945 * returns
946 * TAG for the MBX Cmd
947 * **/
948int be_cmd_set_vlan(struct beiscsi_hba *phba,
949 uint16_t vlan_tag)
950{
951 unsigned int tag = 0;
952 struct be_mcc_wrb *wrb;
953 struct be_cmd_set_vlan_req *req;
954 struct be_ctrl_info *ctrl = &phba->ctrl;
955
956 spin_lock(&ctrl->mbox_lock);
957 tag = alloc_mcc_tag(phba);
958 if (!tag) {
959 spin_unlock(&ctrl->mbox_lock);
960 return tag;
961 }
962
963 wrb = wrb_from_mccq(phba);
964 req = embedded_payload(wrb);
965 wrb->tag0 |= tag;
966 be_wrb_hdr_prepare(wrb, sizeof(*wrb), true, 0);
967 be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ISCSI,
968 OPCODE_COMMON_ISCSI_NTWK_SET_VLAN,
969 sizeof(*req));
970
971 req->interface_hndl = phba->interface_handle;
972 req->vlan_priority = vlan_tag;
973
974 be_mcc_notify(phba);
975 spin_unlock(&ctrl->mbox_lock);
976
977 return tag;
978}