|
Lines 56-61
Link Here
|
| 56 |
#include <sys/disk.h> |
56 |
#include <sys/disk.h> |
| 57 |
#include <sys/malloc.h> |
57 |
#include <sys/malloc.h> |
| 58 |
#include <sys/cdio.h> |
58 |
#include <sys/cdio.h> |
|
|
59 |
#include <sys/cdrio.h> |
| 59 |
#include <sys/dvdio.h> |
60 |
#include <sys/dvdio.h> |
| 60 |
#include <sys/devicestat.h> |
61 |
#include <sys/devicestat.h> |
| 61 |
#include <sys/sysctl.h> |
62 |
#include <sys/sysctl.h> |
|
Lines 231-236
Link Here
|
| 231 |
static int cdpause(struct cam_periph *periph, u_int32_t go); |
232 |
static int cdpause(struct cam_periph *periph, u_int32_t go); |
| 232 |
static int cdstopunit(struct cam_periph *periph, u_int32_t eject); |
233 |
static int cdstopunit(struct cam_periph *periph, u_int32_t eject); |
| 233 |
static int cdstartunit(struct cam_periph *periph); |
234 |
static int cdstartunit(struct cam_periph *periph); |
|
|
235 |
static int cdsetspeed(struct cam_periph *periph, |
| 236 |
u_int16_t rdspeed, u_int16_t wrspeed); |
| 234 |
static int cdreportkey(struct cam_periph *periph, |
237 |
static int cdreportkey(struct cam_periph *periph, |
| 235 |
struct dvd_authinfo *authinfo); |
238 |
struct dvd_authinfo *authinfo); |
| 236 |
static int cdsendkey(struct cam_periph *periph, |
239 |
static int cdsendkey(struct cam_periph *periph, |
|
Lines 2427-2432
Link Here
|
| 2427 |
/* return (cd_reset(periph)); */ |
2430 |
/* return (cd_reset(periph)); */ |
| 2428 |
error = ENOTTY; |
2431 |
error = ENOTTY; |
| 2429 |
break; |
2432 |
break; |
|
|
2433 |
case CDRIOCREADSPEED: |
| 2434 |
error = cdsetspeed(periph, *(u_int16_t *)addr, -1); |
| 2435 |
break; |
| 2436 |
case CDRIOCWRITESPEED: |
| 2437 |
error = cdsetspeed(periph, -1, *(u_int16_t *)addr); |
| 2438 |
break; |
| 2430 |
case DVDIOCSENDKEY: |
2439 |
case DVDIOCSENDKEY: |
| 2431 |
case DVDIOCREPORTKEY: { |
2440 |
case DVDIOCREPORTKEY: { |
| 2432 |
struct dvd_authinfo *authinfo; |
2441 |
struct dvd_authinfo *authinfo; |
|
Lines 3066-3071
Link Here
|
| 3066 |
/* immediate */ FALSE, |
3075 |
/* immediate */ FALSE, |
| 3067 |
/* sense_len */ SSD_FULL_SIZE, |
3076 |
/* sense_len */ SSD_FULL_SIZE, |
| 3068 |
/* timeout */ 50000); |
3077 |
/* timeout */ 50000); |
|
|
3078 |
|
| 3079 |
error = cdrunccb(ccb, cderror, /*cam_flags*/CAM_RETRY_SELTO, |
| 3080 |
/*sense_flags*/SF_RETRY_UA); |
| 3081 |
|
| 3082 |
xpt_release_ccb(ccb); |
| 3083 |
|
| 3084 |
return(error); |
| 3085 |
} |
| 3086 |
|
| 3087 |
static int |
| 3088 |
cdsetspeed(struct cam_periph *periph, u_int16_t rdspeed, u_int16_t wrspeed) |
| 3089 |
{ |
| 3090 |
struct scsi_set_speed *scsi_cmd; |
| 3091 |
struct ccb_scsiio *csio; |
| 3092 |
union ccb *ccb; |
| 3093 |
int error; |
| 3094 |
|
| 3095 |
error = 0; |
| 3096 |
|
| 3097 |
ccb = cdgetccb(periph, /* priority */ 1); |
| 3098 |
|
| 3099 |
csio = &ccb->csio; |
| 3100 |
|
| 3101 |
cam_fill_csio(csio, |
| 3102 |
/* retries */ 1, |
| 3103 |
/* cbfcnp */ cddone, |
| 3104 |
/* flags */ CAM_DIR_NONE, |
| 3105 |
/* tag_action */ MSG_SIMPLE_Q_TAG, |
| 3106 |
/* data_ptr */ NULL, |
| 3107 |
/* dxfer_len */ 0, |
| 3108 |
/* sense_len */ SSD_FULL_SIZE, |
| 3109 |
sizeof(struct scsi_set_speed), |
| 3110 |
/* timeout */ 50000); |
| 3111 |
|
| 3112 |
scsi_cmd = (struct scsi_set_speed *)&csio->cdb_io.cdb_bytes; |
| 3113 |
bzero (scsi_cmd, sizeof(*scsi_cmd)); |
| 3114 |
|
| 3115 |
scsi_cmd->op_code = SET_CD_SPEED; |
| 3116 |
scsi_cmd->readspeed[0]=rdspeed >> 8 & 0xff; |
| 3117 |
scsi_cmd->readspeed[1]=rdspeed & 0xff; |
| 3118 |
scsi_cmd->writespeed[0]=wrspeed >> 8 & 0xff; |
| 3119 |
scsi_cmd->writespeed[1]=wrspeed & 0xff; |
| 3069 |
|
3120 |
|
| 3070 |
error = cdrunccb(ccb, cderror, /*cam_flags*/CAM_RETRY_SELTO, |
3121 |
error = cdrunccb(ccb, cderror, /*cam_flags*/CAM_RETRY_SELTO, |
| 3071 |
/*sense_flags*/SF_RETRY_UA); |
3122 |
/*sense_flags*/SF_RETRY_UA); |