summaryrefslogtreecommitdiffstats
path: root/sys/pci/meteor.c
diff options
context:
space:
mode:
authornectar <nectar@FreeBSD.org>2003-08-26 16:57:24 +0000
committernectar <nectar@FreeBSD.org>2003-08-26 16:57:24 +0000
commit446bd260763fd9ee3710e07af88622edb59ffe8d (patch)
tree6c9cbb82fd2629bf45e321a40d34235ffbdf39da /sys/pci/meteor.c
parentd39b66a2b90c1a9e76975c37a12c4df5f8316891 (diff)
downloadFreeBSD-src-446bd260763fd9ee3710e07af88622edb59ffe8d.zip
FreeBSD-src-446bd260763fd9ee3710e07af88622edb59ffe8d.tar.gz
Revision 1.126 broke the interface of the bktr driver's
METEORSSIGNAL ioctl. Applications use this ioctl with the value METEOR_SIG_MODE_MASK (0xFFFF0000, -65536) to reset signal delivery, but revision 1.126 caused the driver to return EINVAL in this case. Interestingly, the same METEORSSIGNAL ioctl in the meteor driver uses 0 to reset signal delivery. This commit allows METEOR_SIG_MODE_MASK as a synonym for 0 in the bktr driver, and restructures the code a bit so that it is otherwise identical between the bktr and meteor drivers.
Diffstat (limited to 'sys/pci/meteor.c')
-rw-r--r--sys/pci/meteor.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/sys/pci/meteor.c b/sys/pci/meteor.c
index 5751b70..5c808b5 100644
--- a/sys/pci/meteor.c
+++ b/sys/pci/meteor.c
@@ -640,9 +640,9 @@ meteor_intr(void *arg)
* If the user requested to be notified via signal,
* let them know the field is complete.
*/
- if(mtr->proc && (mtr->signal & METEOR_SIG_MODE_MASK)) {
+ if(mtr->proc != NULL) {
PROC_LOCK(mtr->proc);
- psignal(mtr->proc, mtr->signal&(~METEOR_SIG_MODE_MASK));
+ psignal(mtr->proc, mtr->signal);
PROC_UNLOCK(mtr->proc);
}
}
@@ -657,9 +657,9 @@ meteor_intr(void *arg)
* If the user requested to be notified via signal,
* let them know the field is complete.
*/
- if(mtr->proc && (mtr->signal & METEOR_SIG_MODE_MASK)) {
+ if(mtr->proc != NULL) {
PROC_LOCK(mtr->proc);
- psignal(mtr->proc, mtr->signal&(~METEOR_SIG_MODE_MASK));
+ psignal(mtr->proc, mtr->signal);
PROC_UNLOCK(mtr->proc);
}
}
@@ -693,9 +693,9 @@ meteor_intr(void *arg)
* If the user requested to be notified via signal,
* let them know the frame is complete.
*/
- if(mtr->proc && !(mtr->signal & METEOR_SIG_MODE_MASK)) {
+ if(mtr->proc != NULL) {
PROC_LOCK(mtr->proc);
- psignal(mtr->proc, mtr->signal&(~METEOR_SIG_MODE_MASK));
+ psignal(mtr->proc, mtr->signal);
PROC_UNLOCK(mtr->proc);
}
/*
@@ -1334,6 +1334,7 @@ meteor_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct thread *td)
{
int error;
int unit;
+ int sig;
unsigned int temp;
meteor_reg_t *mtr;
struct meteor_counts *cnt;
@@ -1392,14 +1393,12 @@ meteor_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct thread *td)
*(u_short *)arg = mtr->fps;
break;
case METEORSSIGNAL:
- if (*(int *)arg < 0 || *(int *)arg > _SIG_MAXSIG)
- return EINVAL;
- mtr->signal = *(int *) arg;
- if (mtr->signal) {
- mtr->proc = td->td_proc;
- } else {
- mtr->proc = (struct proc *)0;
- }
+ sig = *(int *)arg;
+ /* Applications use 0 to reset signal delivery. */
+ if (sig < 0 || sig > _SIG_MAXSIG)
+ return (EINVAL);
+ mtr->signal = sig;
+ mtr->proc = sig ? td->td_proc : NULL;
break;
case METEORGSIGNAL:
*(int *)arg = mtr->signal;
OpenPOWER on IntegriCloud