aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/target/loopback/tcm_loop.c13
-rw-r--r--drivers/target/target_core_configfs.c4
-rw-r--r--drivers/target/target_core_device.c25
-rw-r--r--drivers/target/tcm_fc/tfc_conf.c8
-rw-r--r--include/target/target_core_fabric_ops.h1
5 files changed, 5 insertions, 46 deletions
diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c
index aed4e464d31c..09681bafe10d 100644
--- a/drivers/target/loopback/tcm_loop.c
+++ b/drivers/target/loopback/tcm_loop.c
@@ -939,18 +939,6 @@ static u16 tcm_loop_get_fabric_sense_len(void)
939 return 0; 939 return 0;
940} 940}
941 941
942static u64 tcm_loop_pack_lun(unsigned int lun)
943{
944 u64 result;
945
946 /* LSB of lun into byte 1 big-endian */
947 result = ((lun & 0xff) << 8);
948 /* use flat space addressing method */
949 result |= 0x40 | ((lun >> 8) & 0x3f);
950
951 return cpu_to_le64(result);
952}
953
954static char *tcm_loop_dump_proto_id(struct tcm_loop_hba *tl_hba) 942static char *tcm_loop_dump_proto_id(struct tcm_loop_hba *tl_hba)
955{ 943{
956 switch (tl_hba->tl_proto_id) { 944 switch (tl_hba->tl_proto_id) {
@@ -1481,7 +1469,6 @@ static int tcm_loop_register_configfs(void)
1481 fabric->tf_ops.set_fabric_sense_len = &tcm_loop_set_fabric_sense_len; 1469 fabric->tf_ops.set_fabric_sense_len = &tcm_loop_set_fabric_sense_len;
1482 fabric->tf_ops.get_fabric_sense_len = &tcm_loop_get_fabric_sense_len; 1470 fabric->tf_ops.get_fabric_sense_len = &tcm_loop_get_fabric_sense_len;
1483 fabric->tf_ops.is_state_remove = &tcm_loop_is_state_remove; 1471 fabric->tf_ops.is_state_remove = &tcm_loop_is_state_remove;
1484 fabric->tf_ops.pack_lun = &tcm_loop_pack_lun;
1485 1472
1486 tf_cg = &fabric->tf_group; 1473 tf_cg = &fabric->tf_group;
1487 /* 1474 /*
diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c
index a5f44a6e6e1d..ee6fad979b50 100644
--- a/drivers/target/target_core_configfs.c
+++ b/drivers/target/target_core_configfs.c
@@ -497,10 +497,6 @@ static int target_fabric_tf_ops_check(
497 printk(KERN_ERR "Missing tfo->is_state_remove()\n"); 497 printk(KERN_ERR "Missing tfo->is_state_remove()\n");
498 return -EINVAL; 498 return -EINVAL;
499 } 499 }
500 if (!(tfo->pack_lun)) {
501 printk(KERN_ERR "Missing tfo->pack_lun()\n");
502 return -EINVAL;
503 }
504 /* 500 /*
505 * We at least require tfo->fabric_make_wwn(), tfo->fabric_drop_wwn() 501 * We at least require tfo->fabric_make_wwn(), tfo->fabric_drop_wwn()
506 * tfo->fabric_make_tpg() and tfo->fabric_drop_tpg() in 502 * tfo->fabric_make_tpg() and tfo->fabric_drop_tpg() in
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index fc10ed4ac493..8407f9ca2b31 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -38,6 +38,7 @@
38#include <net/sock.h> 38#include <net/sock.h>
39#include <net/tcp.h> 39#include <net/tcp.h>
40#include <scsi/scsi.h> 40#include <scsi/scsi.h>
41#include <scsi/scsi_device.h>
41 42
42#include <target/target_core_base.h> 43#include <target/target_core_base.h>
43#include <target/target_core_device.h> 44#include <target/target_core_device.h>
@@ -658,8 +659,7 @@ int transport_core_report_lun_response(struct se_cmd *se_cmd)
658 struct se_session *se_sess = SE_SESS(se_cmd); 659 struct se_session *se_sess = SE_SESS(se_cmd);
659 struct se_task *se_task; 660 struct se_task *se_task;
660 unsigned char *buf = (unsigned char *)T_TASK(se_cmd)->t_task_buf; 661 unsigned char *buf = (unsigned char *)T_TASK(se_cmd)->t_task_buf;
661 u32 cdb_offset = 0, lun_count = 0, offset = 8; 662 u32 cdb_offset = 0, lun_count = 0, offset = 8, i;
662 u64 i, lun;
663 663
664 list_for_each_entry(se_task, &T_TASK(se_cmd)->t_task_list, t_list) 664 list_for_each_entry(se_task, &T_TASK(se_cmd)->t_task_list, t_list)
665 break; 665 break;
@@ -675,15 +675,7 @@ int transport_core_report_lun_response(struct se_cmd *se_cmd)
675 * a $FABRIC_MOD. In that case, report LUN=0 only. 675 * a $FABRIC_MOD. In that case, report LUN=0 only.
676 */ 676 */
677 if (!(se_sess)) { 677 if (!(se_sess)) {
678 lun = 0; 678 int_to_scsilun(0, (struct scsi_lun *)&buf[offset]);
679 buf[offset++] = ((lun >> 56) & 0xff);
680 buf[offset++] = ((lun >> 48) & 0xff);
681 buf[offset++] = ((lun >> 40) & 0xff);
682 buf[offset++] = ((lun >> 32) & 0xff);
683 buf[offset++] = ((lun >> 24) & 0xff);
684 buf[offset++] = ((lun >> 16) & 0xff);
685 buf[offset++] = ((lun >> 8) & 0xff);
686 buf[offset++] = (lun & 0xff);
687 lun_count = 1; 679 lun_count = 1;
688 goto done; 680 goto done;
689 } 681 }
@@ -703,15 +695,8 @@ int transport_core_report_lun_response(struct se_cmd *se_cmd)
703 if ((cdb_offset + 8) >= se_cmd->data_length) 695 if ((cdb_offset + 8) >= se_cmd->data_length)
704 continue; 696 continue;
705 697
706 lun = cpu_to_be64(CMD_TFO(se_cmd)->pack_lun(deve->mapped_lun)); 698 int_to_scsilun(deve->mapped_lun, (struct scsi_lun *)&buf[offset]);
707 buf[offset++] = ((lun >> 56) & 0xff); 699 offset += 8;
708 buf[offset++] = ((lun >> 48) & 0xff);
709 buf[offset++] = ((lun >> 40) & 0xff);
710 buf[offset++] = ((lun >> 32) & 0xff);
711 buf[offset++] = ((lun >> 24) & 0xff);
712 buf[offset++] = ((lun >> 16) & 0xff);
713 buf[offset++] = ((lun >> 8) & 0xff);
714 buf[offset++] = (lun & 0xff);
715 cdb_offset += 8; 700 cdb_offset += 8;
716 } 701 }
717 spin_unlock_irq(&SE_NODE_ACL(se_sess)->device_list_lock); 702 spin_unlock_irq(&SE_NODE_ACL(se_sess)->device_list_lock);
diff --git a/drivers/target/tcm_fc/tfc_conf.c b/drivers/target/tcm_fc/tfc_conf.c
index fcdbbffe88cc..84e868c255dd 100644
--- a/drivers/target/tcm_fc/tfc_conf.c
+++ b/drivers/target/tcm_fc/tfc_conf.c
@@ -519,13 +519,6 @@ static u32 ft_tpg_get_inst_index(struct se_portal_group *se_tpg)
519 return tpg->index; 519 return tpg->index;
520} 520}
521 521
522static u64 ft_pack_lun(unsigned int index)
523{
524 WARN_ON(index >= 256);
525 /* Caller wants this byte-swapped */
526 return cpu_to_le64((index & 0xff) << 8);
527}
528
529static struct target_core_fabric_ops ft_fabric_ops = { 522static struct target_core_fabric_ops ft_fabric_ops = {
530 .get_fabric_name = ft_get_fabric_name, 523 .get_fabric_name = ft_get_fabric_name,
531 .get_fabric_proto_ident = fc_get_fabric_proto_ident, 524 .get_fabric_proto_ident = fc_get_fabric_proto_ident,
@@ -564,7 +557,6 @@ static struct target_core_fabric_ops ft_fabric_ops = {
564 .get_fabric_sense_len = ft_get_fabric_sense_len, 557 .get_fabric_sense_len = ft_get_fabric_sense_len,
565 .set_fabric_sense_len = ft_set_fabric_sense_len, 558 .set_fabric_sense_len = ft_set_fabric_sense_len,
566 .is_state_remove = ft_is_state_remove, 559 .is_state_remove = ft_is_state_remove,
567 .pack_lun = ft_pack_lun,
568 /* 560 /*
569 * Setup function pointers for generic logic in 561 * Setup function pointers for generic logic in
570 * target_core_fabric_configfs.c 562 * target_core_fabric_configfs.c
diff --git a/include/target/target_core_fabric_ops.h b/include/target/target_core_fabric_ops.h
index dc78f77f9450..747e1404dca0 100644
--- a/include/target/target_core_fabric_ops.h
+++ b/include/target/target_core_fabric_ops.h
@@ -77,7 +77,6 @@ struct target_core_fabric_ops {
77 u16 (*set_fabric_sense_len)(struct se_cmd *, u32); 77 u16 (*set_fabric_sense_len)(struct se_cmd *, u32);
78 u16 (*get_fabric_sense_len)(void); 78 u16 (*get_fabric_sense_len)(void);
79 int (*is_state_remove)(struct se_cmd *); 79 int (*is_state_remove)(struct se_cmd *);
80 u64 (*pack_lun)(unsigned int);
81 /* 80 /*
82 * fabric module calls for target_core_fabric_configfs.c 81 * fabric module calls for target_core_fabric_configfs.c
83 */ 82 */