mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
Remove the ability for the user mode programs to specify bidirectional
vs unidirectional transfer modes. The kernel handles hardware, user mode programs shouldn't get in the way. This cleans up some really ugly grots that I hated too. :-) Suggested by: Sujal Patel <smpatel@wam.umd.edu>
This commit is contained in:
parent
b0f4bf0063
commit
b184a4f4e4
2 changed files with 3 additions and 28 deletions
|
|
@ -41,7 +41,7 @@
|
|||
#define QC_GET _IOR('S', 1, struct qcam) /* get parameter structure */
|
||||
#define QC_SET _IOW('S', 2, struct qcam) /* set parameter structure */
|
||||
|
||||
#define QC_IOCTL_VERSION 1 /* version of the structure */
|
||||
#define QC_IOCTL_VERSION 2 /* version of the structure */
|
||||
|
||||
struct qcam {
|
||||
int qc_version; /* version of qcam structure */
|
||||
|
|
@ -50,7 +50,6 @@ struct qcam {
|
|||
int qc_xorigin; /* x origin */
|
||||
int qc_yorigin; /* y origin */
|
||||
int qc_bpp; /* bits per pixel (4 or 6) */
|
||||
int qc_mode; /* transfer mode */
|
||||
int qc_zoom; /* zoom mode */
|
||||
u_char qc_brightness; /* 0..255 */
|
||||
u_char qc_whitebalance; /* 0..255 */
|
||||
|
|
@ -60,12 +59,6 @@ struct qcam {
|
|||
#define QC_MAX_XSIZE 320 /* pixels */
|
||||
#define QC_MAX_YSIZE 240 /* pixels */
|
||||
|
||||
/*
|
||||
* mode flags
|
||||
*/
|
||||
#define QC_MODE_UNIDIR 0x00 /* old slower printer ports */
|
||||
#define QC_MODE_BIDIR 0x01 /* bidirectional transfers */
|
||||
|
||||
/*
|
||||
* zoom flags
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -110,7 +110,6 @@ static struct kern_devconf kdc_qcam_template = {
|
|||
#define QC_OPEN 0x01 /* device open */
|
||||
#define QC_ALIVE 0x02 /* probed and attached */
|
||||
#define QC_BIDIR_HW 0x04 /* bidir parallel port */
|
||||
#define QC_BIDIR_REQ 0x08 /* bidir xfer requested */
|
||||
|
||||
#define QC_MAXFRAMEBUFSIZE (QC_MAX_XSIZE*QC_MAX_YSIZE)
|
||||
|
||||
|
|
@ -360,13 +359,9 @@ qcam_xferparms (struct qcam_softc *qs)
|
|||
|
||||
/*
|
||||
* XXX the && qs->bpp==6 is a temporary hack because we don't
|
||||
* have code for doing 4bpp bidirectional transfers yet
|
||||
* ...soon, my son.
|
||||
* have code for doing 4bpp bidirectional transfers yet.
|
||||
*/
|
||||
|
||||
bidir = (((qs->flags & (QC_BIDIR_HW|QC_BIDIR_REQ)) ==
|
||||
(QC_BIDIR_HW|QC_BIDIR_REQ)) &&
|
||||
(qs->bpp == 6));
|
||||
bidir = (qs->flags & QC_BIDIR_HW) && (qs->bpp == 6);
|
||||
|
||||
if (bidir)
|
||||
qs->xferparms |= QC_XFER_BIDIR;
|
||||
|
|
@ -631,11 +626,6 @@ qcam_ioctl (dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
|
|||
info->qc_brightness = qs->brightness;
|
||||
info->qc_whitebalance = qs->whitebalance;
|
||||
info->qc_contrast = qs->contrast;
|
||||
|
||||
if (qs->flags & QC_BIDIR_REQ)
|
||||
info->qc_mode = QC_MODE_BIDIR;
|
||||
else
|
||||
info->qc_mode = QC_MODE_UNIDIR;
|
||||
break;
|
||||
|
||||
case QC_SET:
|
||||
|
|
@ -655,9 +645,6 @@ qcam_ioctl (dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
|
|||
info->qc_contrast > UCHAR_MAX)
|
||||
return EINVAL;
|
||||
|
||||
if (info->qc_mode & ~QC_MODE_BIDIR)
|
||||
return EINVAL;
|
||||
|
||||
/* version check */
|
||||
if (info->qc_version != QC_IOCTL_VERSION)
|
||||
return EINVAL;
|
||||
|
|
@ -672,11 +659,6 @@ qcam_ioctl (dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
|
|||
qs->whitebalance = info->qc_whitebalance;
|
||||
qs->contrast = info->qc_contrast;
|
||||
|
||||
if (info->qc_mode & QC_MODE_BIDIR)
|
||||
qs->flags |= QC_BIDIR_REQ;
|
||||
else
|
||||
qs->flags &= ~QC_BIDIR_REQ;
|
||||
|
||||
/* request initialization before next scan pass */
|
||||
qs->init_req = 1;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in a new issue