Changeset View
Changeset View
Standalone View
Standalone View
lib/libcam/camlib.c
Show First 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* Malloc a CCB, zero out the header and set its path, target and lun ids. | * Malloc a CCB, zero out the header and set its path, target and lun ids. | ||||
*/ | */ | ||||
union ccb * | union ccb * | ||||
cam_getccb(struct cam_device *dev) | cam_getccb(struct cam_device *dev) | ||||
{ | { | ||||
union ccb *ccb; | union ccb *ccb; | ||||
ccb = (union ccb *)malloc(sizeof(union ccb)); | ccb = calloc(1, sizeof(*ccb)); | ||||
if (ccb != NULL) { | if (ccb != NULL) { | ||||
bzero(&ccb->ccb_h, sizeof(struct ccb_hdr)); | |||||
ccb->ccb_h.path_id = dev->path_id; | ccb->ccb_h.path_id = dev->path_id; | ||||
ccb->ccb_h.target_id = dev->target_id; | ccb->ccb_h.target_id = dev->target_id; | ||||
ccb->ccb_h.target_lun = dev->target_lun; | ccb->ccb_h.target_lun = dev->target_lun; | ||||
} | } | ||||
return(ccb); | return(ccb); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 667 Lines • Show Last 20 Lines |