Changeset View
Changeset View
Standalone View
Standalone View
head/sys/cam/ctl/ctl_frontend_cam_sim.c
Show First 20 Lines • Show All 348 Lines • ▼ Show 20 Lines | for (i = 0, len_seen = 0; i < cam_sg_count; i++) { | ||||
} | } | ||||
len_seen += cam_sglist[i].ds_len; | len_seen += cam_sglist[i].ds_len; | ||||
} | } | ||||
break; | break; | ||||
} | } | ||||
case CAM_DATA_VADDR: | case CAM_DATA_VADDR: | ||||
cam_sglist = &cam_sg_entry; | cam_sglist = &cam_sg_entry; | ||||
cam_sglist[0].ds_len = ccb->csio.dxfer_len; | cam_sglist[0].ds_len = ccb->csio.dxfer_len; | ||||
cam_sglist[0].ds_addr = (bus_addr_t)ccb->csio.data_ptr; | cam_sglist[0].ds_addr = (bus_addr_t)(uintptr_t)ccb->csio.data_ptr; | ||||
cam_sg_count = 1; | cam_sg_count = 1; | ||||
cam_sg_start = 0; | cam_sg_start = 0; | ||||
cam_sg_offset = io->scsiio.kern_rel_offset; | cam_sg_offset = io->scsiio.kern_rel_offset; | ||||
break; | break; | ||||
default: | default: | ||||
panic("Invalid CAM flags %#x", ccb->ccb_h.flags); | panic("Invalid CAM flags %#x", ccb->ccb_h.flags); | ||||
} | } | ||||
Show All 11 Lines | cfcs_datamove(union ctl_io *io) | ||||
cam_watermark = cam_sg_offset; | cam_watermark = cam_sg_offset; | ||||
for (i = cam_sg_start, j = 0; | for (i = cam_sg_start, j = 0; | ||||
i < cam_sg_count && j < ctl_sg_count;) { | i < cam_sg_count && j < ctl_sg_count;) { | ||||
uint8_t *cam_ptr, *ctl_ptr; | uint8_t *cam_ptr, *ctl_ptr; | ||||
len_to_copy = MIN(cam_sglist[i].ds_len - cam_watermark, | len_to_copy = MIN(cam_sglist[i].ds_len - cam_watermark, | ||||
ctl_sglist[j].len - ctl_watermark); | ctl_sglist[j].len - ctl_watermark); | ||||
cam_ptr = (uint8_t *)cam_sglist[i].ds_addr; | cam_ptr = (uint8_t *)(uintptr_t)cam_sglist[i].ds_addr; | ||||
cam_ptr = cam_ptr + cam_watermark; | cam_ptr = cam_ptr + cam_watermark; | ||||
if (io->io_hdr.flags & CTL_FLAG_BUS_ADDR) { | if (io->io_hdr.flags & CTL_FLAG_BUS_ADDR) { | ||||
/* | /* | ||||
* XXX KDM fix this! | * XXX KDM fix this! | ||||
*/ | */ | ||||
panic("need to implement bus address support"); | panic("need to implement bus address support"); | ||||
#if 0 | #if 0 | ||||
kern_ptr = bus_to_virt(kern_sglist[j].addr); | kern_ptr = bus_to_virt(kern_sglist[j].addr); | ||||
▲ Show 20 Lines • Show All 420 Lines • Show Last 20 Lines |