[cam_periph_mapmen:?]

Heck, Steve Steve.Heck at am.sony.com
Thu Aug 4 22:18:44 GMT 2005


I am having problems Writing to a SCSI tape drive.  

First the Block Size is being set to 65536 Bytes by Mode Select which succeeds.

printf ("Data compression enabled.\n");
  
  buf_data1c[0] = 0x00;
  buf_data1c[1] = 0x00;
  buf_data1c[2] = 0x10;
  buf_data1c[3] = 0x08;
  buf_data1c[4] = 0x7f;
  buf_data1c[5] = 0x00;
  buf_data1c[6] = 0x00;
  buf_data1c[7] = 0x00;
  buf_data1c[8] = 0x00;
  buf_data1c[9] = 0x01;
  buf_data1c[10] = 0x00;
  buf_data1c[11] = 0x00;
  buf_data1c[12] = 0x0f;
  buf_data1c[13] = 0x0e;
  buf_data1c[14] = 0xc0;
  buf_data1c[15] = 0x80;
  buf_data1c[16] = 0x00;
  buf_data1c[17] = 0x00;
  buf_data1c[18] = 0x00;
  buf_data1c[19] = 0x00;
  buf_data1c[20] = 0x00;
  buf_data1c[21] = 0x00;
  buf_data1c[22] = 0x00;
  buf_data1c[23] = 0x00;
  buf_data1c[24] = 0x00;
  buf_data1c[25] = 0x00;
  buf_data1c[26] = 0x00;
  buf_data1c[27] = 0x00;

  //unsigned char header[len];
  memset( header, 0, len );
  memset(&ccb,0,sizeof(ccb));
  ccb.ccb_h.path_id    = cam->path_id;
  ccb.ccb_h.target_id  = cam->target_id;
  ccb.ccb_h.target_lun = cam->target_lun;
  cam_fill_csio (&(ccb.csio), 1, NULL, CAM_DIR_OUT, MSG_SIMPLE_Q_TAG, buf_data1c, sizeof(buf_data1c), sizeof(ccb.csio.sense_data), 0, 30*1000);
  ccb.csio.cdb_len = 6;
  ccb.csio.cdb_io.cdb_bytes[0] = 0x15;	// Mode Select
  ccb.csio.cdb_io.cdb_bytes[1] = 0x10;
  ccb.csio.cdb_io.cdb_bytes[4] = 0x1c;
  ccb.csio.cdb_io.cdb_bytes[5] = 0x00;  
 
  //int ret;
  if ((ret = cam_send_ccb(cam, &ccb)) < 0)
  {
      printf("cam_send_ccb: failed\n");
      cam_close_device(cam);
      return -1;
  }


The problem occurs when I try to Write one Fixed Block.


  unsigned char wbuf_data[65536]

  memset( header, 0, len );
  memset(&ccb,0,sizeof(ccb));
  ccb.ccb_h.path_id    = cam->path_id;
  ccb.ccb_h.target_id  = cam->target_id;
  ccb.ccb_h.target_lun = cam->target_lun;
  cam_fill_csio (&(ccb.csio), 1, NULL, CAM_DIR_OUT, MSG_SIMPLE_Q_TAG, wbuf_data, sizeof(wbuf_data), sizeof(ccb.csio.sense_data), 0, 900*1000);
  ccb.csio.cdb_len = 6;
  ccb.csio.cdb_io.cdb_bytes[0] = 0x0a;	// Write
  ccb.csio.cdb_io.cdb_bytes[1] = 0x01;
  ccb.csio.cdb_io.cdb_bytes[4] = 0x01;
  ccb.csio.cdb_io.cdb_bytes[5] = 0x00;  

if ((ret = cam_send_ccb(cam, &ccb)) < 0)
  {
      printf("cam_send_ccb: failed\n");
      cam_close_device(cam);
      return -1;
  }

I get this error:

cam_periph_mapmem: attempt to map 68480 bytes, which is greater that DFLTPHYS(65536)

cam_send_ccb: failed

I do not see the Write cdb being sent when I make a SCSI trace. 

Any help would be appreciated.

Thanks,
Steve




More information about the freebsd-scsi mailing list