mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-17 15:27:36 +00:00
Explicitly decode GetAllNext SNS Response back *as*
a GetAllNext response. Otherwise, we won't unswizzle it correctly. This was found on linux/PPC. This mandated creating another inline: isp_get_gan_response.
This commit is contained in:
parent
41a35633ba
commit
c748b5e634
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=87671
@ -2282,7 +2282,7 @@ isp_scan_fabric(struct ispsoftc *isp)
|
||||
for (first_portid_seen = hicap = 0; hicap < 65535; hicap++) {
|
||||
mbreg_t mbs;
|
||||
sns_screq_t *rq;
|
||||
sns_scrsp_t *rs0, *rs1;
|
||||
sns_ganrsp_t *rs0, *rs1;
|
||||
u_int8_t sc[SNS_GAN_REQ_SIZE];
|
||||
|
||||
rq = (sns_screq_t *)sc;
|
||||
@ -2349,9 +2349,9 @@ isp_scan_fabric(struct ispsoftc *isp)
|
||||
return (-1);
|
||||
}
|
||||
MEMORYBARRIER(isp, SYNC_SFORCPU, 0x100, SNS_GAN_RESP_SIZE);
|
||||
rs1 = (sns_scrsp_t *) fcp->isp_scratch;
|
||||
rs0 = (sns_scrsp_t *) ((u_int8_t *)fcp->isp_scratch + 0x100);
|
||||
isp_get_sns_response(isp, rs0, rs1, SNS_GAN_RESP_SIZE >> 1);
|
||||
rs1 = (sns_ganrsp_t *) fcp->isp_scratch;
|
||||
rs0 = (sns_ganrsp_t *) ((u_int8_t *)fcp->isp_scratch + 0x100);
|
||||
isp_get_gan_response(isp, rs0, rs1);
|
||||
portid = (((u_int32_t) rs1->snscb_port_id[0]) << 16) |
|
||||
(((u_int32_t) rs1->snscb_port_id[1]) << 8) |
|
||||
(((u_int32_t) rs1->snscb_port_id[2]));
|
||||
|
@ -276,6 +276,8 @@ static INLINE void
|
||||
isp_put_sns_request(struct ispsoftc *, sns_screq_t *, sns_screq_t *);
|
||||
static INLINE void
|
||||
isp_get_sns_response(struct ispsoftc *, sns_scrsp_t *, sns_scrsp_t *, int);
|
||||
static INLINE void
|
||||
isp_get_gan_response(struct ispsoftc *, sns_ganrsp_t *, sns_ganrsp_t *);
|
||||
#ifdef ISP_TARGET_MODE
|
||||
#ifndef _ISP_TARGET_H
|
||||
#include "isp_target.h"
|
||||
@ -690,6 +692,59 @@ isp_get_sns_response(struct ispsoftc *isp, sns_scrsp_t *src,
|
||||
}
|
||||
}
|
||||
|
||||
static INLINE void
|
||||
isp_get_gan_response(struct ispsoftc *isp, sns_ganrsp_t *src, sns_ganrsp_t *dst)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < 16; i++) {
|
||||
ISP_IOXGET_8(isp, &src->snscb_cthdr[i], dst->snscb_cthdr[i]);
|
||||
}
|
||||
ISP_IOXGET_8(isp, &src->snscb_port_type, dst->snscb_port_type);
|
||||
for (i = 0; i < 3; i++) {
|
||||
ISP_IOXGET_8(isp, &src->snscb_port_id[i],
|
||||
dst->snscb_port_id[i]);
|
||||
}
|
||||
for (i = 0; i < 8; i++) {
|
||||
ISP_IOXGET_8(isp, &src->snscb_portname[i],
|
||||
dst->snscb_portname[i]);
|
||||
}
|
||||
ISP_IOXGET_8(isp, &src->snscb_pnlen, dst->snscb_pnlen);
|
||||
for (i = 0; i < 255; i++) {
|
||||
ISP_IOXGET_8(isp, &src->snscb_pname[i], dst->snscb_pname[i]);
|
||||
}
|
||||
for (i = 0; i < 8; i++) {
|
||||
ISP_IOXGET_8(isp, &src->snscb_nodename[i],
|
||||
dst->snscb_nodename[i]);
|
||||
}
|
||||
ISP_IOXGET_8(isp, &src->snscb_nnlen, dst->snscb_nnlen);
|
||||
for (i = 0; i < 255; i++) {
|
||||
ISP_IOXGET_8(isp, &src->snscb_nname[i], dst->snscb_nname[i]);
|
||||
}
|
||||
for (i = 0; i < 8; i++) {
|
||||
ISP_IOXGET_8(isp, &src->snscb_ipassoc[i],
|
||||
dst->snscb_ipassoc[i]);
|
||||
}
|
||||
for (i = 0; i < 16; i++) {
|
||||
ISP_IOXGET_8(isp, &src->snscb_ipaddr[i], dst->snscb_ipaddr[i]);
|
||||
}
|
||||
for (i = 0; i < 4; i++) {
|
||||
ISP_IOXGET_8(isp, &src->snscb_svc_class[i],
|
||||
dst->snscb_svc_class[i]);
|
||||
}
|
||||
for (i = 0; i < 32; i++) {
|
||||
ISP_IOXGET_8(isp, &src->snscb_fc4_types[i],
|
||||
dst->snscb_fc4_types[i]);
|
||||
}
|
||||
for (i = 0; i < 8; i++) {
|
||||
ISP_IOXGET_8(isp, &src->snscb_fpname[i], dst->snscb_fpname[i]);
|
||||
}
|
||||
ISP_IOXGET_8(isp, &src->snscb_reserved, dst->snscb_reserved);
|
||||
for (i = 0; i < 3; i++) {
|
||||
ISP_IOXGET_8(isp, &src->snscb_hardaddr[i],
|
||||
dst->snscb_hardaddr[i]);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef ISP_TARGET_MODE
|
||||
static INLINE void
|
||||
isp_put_atio(struct ispsoftc *isp, at_entry_t *atsrc, at_entry_t *atdst)
|
||||
|
Loading…
Reference in New Issue
Block a user