summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2017-03-29 16:02:50 +0000
committermav <mav@FreeBSD.org>2017-03-29 16:02:50 +0000
commitbae211cf05d1c9749a17e28075db3a17d2b15c55 (patch)
treea45d4a206d743ff608133ee64e1d3126d72d2fcb
parent5e441f5b401a8eb06a59aa2b8b6dc831f62ca94b (diff)
downloadFreeBSD-src-bae211cf05d1c9749a17e28075db3a17d2b15c55.zip
FreeBSD-src-bae211cf05d1c9749a17e28075db3a17d2b15c55.tar.gz
MFC r315488: Extend nt_lun to full 8 byte.
-rw-r--r--sys/dev/isp/isp_freebsd.c5
-rw-r--r--sys/dev/isp/isp_target.c10
-rw-r--r--sys/dev/isp/isp_target.h7
3 files changed, 11 insertions, 11 deletions
diff --git a/sys/dev/isp/isp_freebsd.c b/sys/dev/isp/isp_freebsd.c
index 748c2ca..80621e3 100644
--- a/sys/dev/isp/isp_freebsd.c
+++ b/sys/dev/isp/isp_freebsd.c
@@ -2303,7 +2303,8 @@ isp_handle_platform_notify_fc(ispsoftc_t *isp, in_fcentry_t *inp)
break;
case IN_ABORT_TASK:
{
- uint16_t nphdl, lun;
+ lun_id_t lun;
+ uint16_t nphdl;
uint32_t sid;
uint64_t wwn;
fcportdb_t *lp;
@@ -2602,7 +2603,7 @@ isp_handle_platform_target_tmf(ispsoftc_t *isp, isp_notify_t *notify)
inot_private_data_t *ntp = NULL;
lun_id_t lun;
- isp_prt(isp, ISP_LOGTDEBUG0, "%s: code 0x%x sid 0x%x tagval 0x%016llx chan %d lun 0x%x", __func__, notify->nt_ncode,
+ isp_prt(isp, ISP_LOGTDEBUG0, "%s: code 0x%x sid 0x%x tagval 0x%016llx chan %d lun %jx", __func__, notify->nt_ncode,
notify->nt_sid, (unsigned long long) notify->nt_tagval, notify->nt_channel, notify->nt_lun);
/*
* NB: This assignment is necessary because of tricky type conversion.
diff --git a/sys/dev/isp/isp_target.c b/sys/dev/isp/isp_target.c
index 00f20fc..e2aa2c3 100644
--- a/sys/dev/isp/isp_target.c
+++ b/sys/dev/isp/isp_target.c
@@ -709,8 +709,8 @@ static void
isp_got_msg_fc(ispsoftc_t *isp, in_fcentry_t *inp)
{
isp_notify_t notify;
- static const char f1[] = "%s from N-port handle 0x%x lun %x seq 0x%x";
- static const char f2[] = "unknown %s 0x%x lun %x N-Port handle 0x%x task flags 0x%x seq 0x%x\n";
+ static const char f1[] = "%s from N-port handle 0x%x lun %jx seq 0x%x";
+ static const char f2[] = "unknown %s 0x%x lun %jx N-Port handle 0x%x task flags 0x%x seq 0x%x\n";
uint16_t seqid, nphdl;
ISP_MEMZERO(&notify, sizeof (isp_notify_t));
@@ -772,8 +772,8 @@ static void
isp_got_tmf_24xx(ispsoftc_t *isp, at7_entry_t *aep)
{
isp_notify_t notify;
- static const char f1[] = "%s from PortID 0x%06x lun %x seq 0x%08x";
- static const char f2[] = "unknown Task Flag 0x%x lun %x PortID 0x%x tag 0x%08x";
+ static const char f1[] = "%s from PortID 0x%06x lun %jx seq 0x%08x";
+ static const char f2[] = "unknown Task Flag 0x%x lun %jx PortID 0x%x tag 0x%08x";
fcportdb_t *lp;
uint16_t chan;
uint32_t sid, did;
@@ -781,7 +781,7 @@ isp_got_tmf_24xx(ispsoftc_t *isp, at7_entry_t *aep)
ISP_MEMZERO(&notify, sizeof (isp_notify_t));
notify.nt_hba = isp;
notify.nt_wwn = INI_ANY;
- notify.nt_lun = (aep->at_cmnd.fcp_cmnd_lun[0] << 8) | (aep->at_cmnd.fcp_cmnd_lun[1]);
+ notify.nt_lun = CAM_EXTLUN_BYTE_SWIZZLE(be64dec(aep->at_cmnd.fcp_cmnd_lun));
notify.nt_tagval = aep->at_rxid;
notify.nt_tagval |= (((uint64_t)(isp->isp_serno++)) << 32);
notify.nt_lreserved = aep;
diff --git a/sys/dev/isp/isp_target.h b/sys/dev/isp/isp_target.h
index a75d73b..5c42732 100644
--- a/sys/dev/isp/isp_target.h
+++ b/sys/dev/isp/isp_target.h
@@ -64,16 +64,15 @@ typedef struct isp_notify {
uint64_t nt_wwn; /* source (wwn) */
uint64_t nt_tgt; /* destination (wwn) */
uint64_t nt_tagval; /* tag value */
+ lun_id_t nt_lun; /* logical unit */
uint32_t
nt_sid : 24; /* source port id */
uint32_t
nt_failed : 1, /* notify operation failed */
nt_need_ack : 1, /* this notify needs an ACK */
nt_did : 24; /* destination port id */
- uint32_t
- nt_lun : 16, /* logical unit */
- nt_nphdl : 16; /* n-port handle */
- uint8_t nt_channel; /* channel id */
+ uint16_t nt_nphdl; /* n-port handle */
+ uint8_t nt_channel; /* channel id */
isp_ncode_t nt_ncode; /* action */
} isp_notify_t;
#define MATCH_TMD(tmd, iid, lun, tag) \
OpenPOWER on IntegriCloud