Changeset View
Changeset View
Standalone View
Standalone View
sbin/camcontrol/camcontrol.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 1,903 Lines • ▼ Show 20 Lines | ata_do_cmd(struct cam_device *device, union ccb *ccb, int retries, | ||||
if (ata_flags & AP_FLAG_CHK_COND) | if (ata_flags & AP_FLAG_CHK_COND) | ||||
ccb->ataio.cmd.flags |= CAM_ATAIO_NEEDRESULT; | ccb->ataio.cmd.flags |= CAM_ATAIO_NEEDRESULT; | ||||
return ata_cam_send(device, ccb); | return ata_cam_send(device, ccb); | ||||
} | } | ||||
static void | static void | ||||
dump_data(uint16_t *ptr, uint32_t len) | dump_data(char *ptr, size_t len) | ||||
{ | { | ||||
u_int i; | u_int i; | ||||
uint16_t x; | |||||
for (i = 0; i < len / 2; i++) { | for (i = 0; i < len / sizeof(x); i++) { | ||||
if ((i % 8) == 0) | if ((i % 8) == 0) | ||||
printf(" %3d: ", i); | printf(" %3d: ", i); | ||||
printf("%04hx ", ptr[i]); | memcpy(&x, &ptr[i * sizeof(x)], sizeof(x)); | ||||
printf("%04hx ", x); | |||||
if ((i % 8) == 7) | if ((i % 8) == 7) | ||||
printf("\n"); | printf("\n"); | ||||
} | } | ||||
if ((i % 8) != 7) | if ((i % 8) != 7) | ||||
printf("\n"); | printf("\n"); | ||||
} | } | ||||
static int | static int | ||||
▲ Show 20 Lines • Show All 8,670 Lines • Show Last 20 Lines |