FreeBSD Bugzilla – Attachment 188806 Details for
Bug 224250
Sending SCSI command to ATA device makes kernel triple fault.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
C snippet
fbsd224250.c (text/x-csrc), 1011 bytes, created by
Natalia Portillo
on 2017-12-13 18:19:39 UTC
(
hide
)
Description:
C snippet
Filename:
MIME Type:
Creator:
Natalia Portillo
Created:
2017-12-13 18:19:39 UTC
Size:
1011 bytes
patch
obsolete
>#include <stdio.h> >#include <camlib.h> >#include <stdlib.h> >#include <cam/cam_ccb.h> >#include <fcntl.h> > >void main() >{ > struct cam_device *dev; > union ccb *ccb; > unsigned char* buffer = malloc(36); > > dev = cam_open_device("/dev/cd0", O_RDWR); > ccb = cam_getccb(dev); > ccb->ccb_h.func_code = XPT_SCSI_IO; > ccb->ccb_h.flags = CAM_DIR_IN; > ccb->ccb_h.xflags = 0; > ccb->ccb_h.retry_count = 1; > ccb->ccb_h.cbfcnp = 0; > ccb->ccb_h.timeout = 10000; > ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; > ccb->csio.data_ptr = buffer; > ccb->csio.dxfer_len = 36; > ccb->csio.sense_len = 32; > ccb->csio.cdb_len = 6; > ccb->csio.tag_action = 0x20; > ccb->csio.cdb_io.cdb_bytes[0] = 0x12; > ccb->csio.cdb_io.cdb_bytes[1] = 0; > ccb->csio.cdb_io.cdb_bytes[2] = 0; > ccb->csio.cdb_io.cdb_bytes[3] = 0; > ccb->csio.cdb_io.cdb_bytes[4] = 36; > ccb->csio.cdb_io.cdb_bytes[5] = 0; > > int error = cam_send_ccb(dev, ccb); > > cam_freeccb(ccb); > cam_close_device(dev); >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 224250
: 188806 |
188807
|
188831