/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
*
* dcam1394 driver. Device parameter access.
*/
#include <sys/tnf_probe.h>
/* index by vid_mode */
int g_frame_num_bytes[] = {
57600, /* vid mode 0 */
153600, /* vid mode 1 */
460800, /* vid mode 2 */
614400, /* vid mode 3 */
921600, /* vid mode 4 */
307200 /* vid mode 5 */
};
/*
* param_attr_init
*/
int
{
/*
* power ctrl cap
*/
/*
* video mode cap
*/
for (subparam = DCAM1394_SUBPARAM_VID_MODE_0;
}
/*
* frame rate cap
*/
}
}
/*
* power
*/
if (cap_power_ctrl) {
}
/*
* video mode
*/
/*
* frame rate
*/
/*
* ring buffer capacity
*/
/*
* ring buffer: num frames ready
*/
/*
* ring buffer: read ptr increment stride
*/
/*
* frame size
*/
/*
* cam status
*/
/*
* features
*/
param++) {
/*
* get feature presence
* If the operation to read the parameter fails, then act as
* though the feature is not implemented (because it isn't),
* don't report a DDI failure (as was previously done).
*/
if (!err) {
/* feature presence */
if (presence) {
/* feature cap read */
/* feature cap ctrl auto */
/* feature cap ctrl manual */
/* feature min val */
/* feature max val */
if (cap_on_off) {
}
/* feature control mode */
/* get value read-out capability */
&cap_read);
if (param == DCAM1394_PARAM_WHITE_BALANCE) {
/*
* white balance feature: u, v value
*/
if (cap_read) {
}
if (cap_read) {
}
} else {
/* feature value */
if (cap_read) {
}
}
}
}
}
return (ret_err);
}
/*
* param_attr_set
*/
void
{
}
/*
* dcam1394_ioctl_param_get
*
* softc's param_attr field must be initialized via param_attr_init()
* before using this function.
*/
int
{
ret_err = 0;
for (subparam = 0;
subparam++) {
is_valid =
cap_get =
ret_err = 1;
}
if (!err) {
val;
}
} else {
ret_err = 1;
}
}
}
}
return (ret_err);
}
/*
* dcam1394_ioctl_param_set
* softc's param_attr field must be initialized via param_attr_init()
* before using this function.
*/
int
{
int ret_err;
ret_err = 0;
for (subparam = 0;
subparam++) {
is_valid =
cap_set = is_ctrl_file ?
& CAP_CTRL_SET) :
& CAP_SET);
ret_err = 1;
}
} else {
ret_err = 1;
}
}
}
}
return (ret_err);
}
/*
* dcam1394_param_get
*/
int
{
int err;
switch (param) {
break;
break;
break;
case DCAM1394_PARAM_POWER:
break;
case DCAM1394_PARAM_VID_MODE:
break;
break;
break;
break;
break;
break;
case DCAM1394_PARAM_STATUS:
break;
break;
case DCAM1394_PARAM_EXPOSURE:
break;
case DCAM1394_PARAM_SHARPNESS:
break;
break;
case DCAM1394_PARAM_HUE:
break;
break;
case DCAM1394_PARAM_GAMMA:
break;
case DCAM1394_PARAM_SHUTTER:
break;
case DCAM1394_PARAM_GAIN:
break;
case DCAM1394_PARAM_IRIS:
break;
case DCAM1394_PARAM_FOCUS:
break;
case DCAM1394_PARAM_ZOOM:
break;
case DCAM1394_PARAM_PAN:
break;
case DCAM1394_PARAM_TILT:
break;
default:
err = 1;
break;
}
return (err);
}
/*
* dcam1394_param_set
*/
int
{
int err;
switch (param) {
case DCAM1394_PARAM_POWER:
break;
case DCAM1394_PARAM_VID_MODE:
break;
break;
break;
break;
break;
case DCAM1394_PARAM_EXPOSURE:
break;
case DCAM1394_PARAM_SHARPNESS:
break;
break;
case DCAM1394_PARAM_HUE:
break;
break;
case DCAM1394_PARAM_GAMMA:
break;
case DCAM1394_PARAM_SHUTTER:
break;
case DCAM1394_PARAM_GAIN:
break;
case DCAM1394_PARAM_IRIS:
break;
case DCAM1394_PARAM_FOCUS:
break;
case DCAM1394_PARAM_ZOOM:
break;
case DCAM1394_PARAM_PAN:
break;
case DCAM1394_PARAM_TILT:
break;
default:
err = 1;
break;
}
return (err);
}
/*
* feature_get
*/
int
{
switch (subparam) {
case DCAM1394_SUBPARAM_ON_OFF:
case DCAM1394_SUBPARAM_VALUE:
return (1);
}
break;
return (1);
}
break;
default:
return (1);
}
return (0);
}
/*
* feature_set
*/
int
{
return (1);
}
return (1);
}
return (0);
}
/*
* param_cap_power_ctrl_get
*/
int
{
return (1);
}
return (0);
}
/*
* param_cap_vid_mode_get
* dcam spec: sec 1.2.1.1
*/
int
{
return (1);
}
return (0);
}
/*
* param_cap_frame_rate_get()
* dcam spec: sec 1.2.2
*/
int
{
return (1);
}
return (0);
}
/*
* param_power_get
*/
int
{
return (1);
}
return (0);
}
/*
* param_power_set()
*/
int
{
return (1);
}
return (0);
}
/*
* param_vid_mode_get
*/
int
{
return (1);
}
return (0);
}
/*
* param_vid_mode_set
*/
int
{
return (1);
}
/*
* if we are currently receiving frames, we need to do a restart
* so that the new vid mode value takes effect
*/
(void) dcam_frame_rcv_stop(softc_p);
(void) dcam1394_ioctl_frame_rcv_start(softc_p);
}
return (0);
}
/*
* param_frame_rate_get
*/
int
{
return (1);
}
return (0);
}
/*
* param_frame_rate_set
*/
int
{
/* if we are currently receiving frames, stop the camera */
(void) dcam_frame_rcv_stop(softc_p);
return (1);
}
/*
* Update the state info.
* note: the driver maintains frame rate in an array
* whereas the the camera uses predefined values whose
* lowest frame rate starts at 6
*/
/* restart the camera */
(void) dcam1394_ioctl_frame_rcv_start(softc_p);
} else {
return (1);
}
/* see note above re skewing of value by 6 */
}
return (0);
}
/*
* param_ring_buff_capacity_get()
*/
int
{
return (0);
}
/*
* param_ring_buff_capacity_set
*/
int
{
/* bounds check */
return (1);
}
/* update our state info */
/*
* if we are currently receiving frames, we need to do a restart
* so that the new buff_capacity value takes effect
*/
(void) dcam_frame_rcv_stop(softc_p);
(void) dcam1394_ioctl_frame_rcv_start(softc_p);
}
return (0);
}
/*
* param_ring_buff_num_frames_ready_get()
*/
int
{
/*
* note: currently we support only one read_ptr_id, so the
* following logic will work. If multiple read_ptr_id's are
* supported, this function call will need to receive a
* read_ptr_id
*/
return (1);
}
} else {
}
return (0);
}
/*
* param_ring_buff_read_ptr_incr_get()
*/
int
{
return (1);
}
return (0);
}
/*
* param_ring_buff_read_ptr_incr_set
*/
int
{
return (1);
}
return (0);
}
/*
* param_frame_num_bytes_get
*/
int
{
return (1);
}
return (0);
}
/*
* param_status_get()
*/
int
{
softc_p->param_status = 0;
return (0);
}
/*
* param_brightness_get
*/
int
{
int ret_val;
return (ret_val);
}
/*
* param_brightness_set()
*/
int
{
int ret_val;
return (ret_val);
}
/*
* param_exposure_get
*/
int
{
int ret_val;
return (ret_val);
}
/*
* param_exposure_set
*/
int
{
int ret_val;
return (ret_val);
}
/*
* param_sharpness_get
*/
int
{
int ret_val;
return (ret_val);
}
/*
* param_sharpness_set
*/
int
{
int ret_val;
return (ret_val);
}
/*
* param_white_balance_get
*/
int
{
int ret_val;
return (ret_val);
}
/*
* param_white_balance_set
*/
int
{
int ret_val;
return (ret_val);
}
/*
* param_hue_get
*/
int
{
int ret_val;
return (ret_val);
}
/*
* param_hue_set
*/
int
{
int ret_val;
return (ret_val);
}
/*
* param_saturation_get
*/
int
{
int ret_val;
return (ret_val);
}
/*
* param_saturation_set
*/
int
{
int ret_val;
return (ret_val);
}
/*
* param_gamma_get
*/
int
{
int ret_val;
return (ret_val);
}
/*
* param_gamma_set
*/
int
{
int ret_val;
return (ret_val);
}
/*
* param_shutter_get
*/
int
{
int ret_val;
return (ret_val);
}
/*
* param_shutter_set
*/
int
{
int ret_val;
return (ret_val);
}
/*
* param_gain_get
*/
int
{
int ret_val;
return (ret_val);
}
/*
* param_gain_set
*/
int
{
int ret_val;
return (ret_val);
}
/*
* param_iris_get
*/
int
{
int ret_val;
switch (subparam) {
*val_p = 0;
break;
case DCAM1394_SUBPARAM_ON_OFF:
*val_p = 1;
break;
case DCAM1394_SUBPARAM_VALUE:
*val_p = 4;
break;
default:
break;
}
return (ret_val);
}
/*
* param_iris_set
*/
int
{
int ret_val;
if (subparam == DCAM1394_SUBPARAM_ON_OFF) {
val = 1;
} else if (subparam == DCAM1394_SUBPARAM_VALUE) {
val = 4;
}
return (ret_val);
}
/*
* param_focus_get
*/
int
{
int ret_val;
return (ret_val);
}
/*
* param_focus_set
*/
int
{
int ret_val;
return (ret_val);
}
/*
* param_zoom_get
*/
int
{
int ret_val;
return (ret_val);
}
/*
* param_zoom_set
*/
int
{
int ret_val;
return (ret_val);
}
/*
* param_pan_get
*/
int
{
int ret_val;
return (ret_val);
}
/*
* param_pan_set
*/
int
{
int ret_val;
return (ret_val);
}
/*
* param_tilt_get
*/
int
{
int ret_val;
return (ret_val);
}
/*
* param_tilt_set
*/
int
{
int ret_val;
return (ret_val);
}
/*
* feature_csr_val_construct
*/
static uint_t
{
switch (subparam) {
case DCAM1394_SUBPARAM_ON_OFF:
break;
break;
case DCAM1394_SUBPARAM_VALUE:
break;
break;
break;
default:
break;
}
return (ret_val);
}
/*
* feature_csr_val_subparam_extract
*/
static uint_t
{
switch (subparam) {
break;
case DCAM1394_SUBPARAM_ON_OFF:
break;
break;
case DCAM1394_SUBPARAM_VALUE:
break;
break;
break;
default:
ret_val = 0;
break;
}
return (ret_val);
}
/*
* feature_elm_inq_reg_val_subparam_extract
*/
static uint_t
{
switch (subparam) {
break;
break;
break;
break;
break;
break;
default:
ret_val = 0;
break;
}
return (ret_val);
}