summaryrefslogtreecommitdiffstats
path: root/drivers/block/paride
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-06-17 13:25:08 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-06-17 13:25:08 +0000
commit59223edaa18759982db0a8aced0e77457d10c68e (patch)
tree89354903b01fa0a447bffeefe00df3044495db2e /drivers/block/paride
parentdb7d4daea91e105e3859cf461d7e53b9b77454b2 (diff)
Merge with Linux 2.3.6. Sorry, this isn't tested on silicon, I don't
have a MIPS box at hand.
Diffstat (limited to 'drivers/block/paride')
-rw-r--r--drivers/block/paride/paride.c4
-rw-r--r--drivers/block/paride/paride.h2
-rw-r--r--drivers/block/paride/pd.c29
-rw-r--r--drivers/block/paride/pf.c26
4 files changed, 19 insertions, 42 deletions
diff --git a/drivers/block/paride/paride.c b/drivers/block/paride/paride.c
index 6e962d8c1..9e238803e 100644
--- a/drivers/block/paride/paride.c
+++ b/drivers/block/paride/paride.c
@@ -247,7 +247,7 @@ static void pi_register_parport( PIA *pi, int verbose)
pi->pardev = (void *) parport_register_device(
pp,pi->device,NULL,pi_wake_up,NULL,0,(void *)pi);
- pi->parq = NULL;
+ init_waitqueue_head(&pi->parq);
if (verbose) printk("%s: 0x%x is %s\n",pi->device,pi->port,pp->name);
@@ -357,7 +357,7 @@ int pi_init(PIA *pi, int autoprobe, int port, int mode,
pi->parname = NULL;
pi->pardev = NULL;
- pi->parq = NULL;
+ init_waitqueue_head(&pi->parq);
pi->claimed = 0;
pi->claim_cont = NULL;
diff --git a/drivers/block/paride/paride.h b/drivers/block/paride/paride.h
index 6d37736ec..e08e07e65 100644
--- a/drivers/block/paride/paride.h
+++ b/drivers/block/paride/paride.h
@@ -44,7 +44,7 @@ struct pi_adapter {
int reserved; /* number of ports reserved */
int private; /* for protocol module */
- struct wait_queue *parq; /* semaphore for parport sharing */
+ wait_queue_head_t parq; /* semaphore for parport sharing */
void *pardev; /* pointer to pardevice */
char *parname; /* parport name */
int claimed; /* parport has already been claimed */
diff --git a/drivers/block/paride/pd.c b/drivers/block/paride/pd.c
index 3518a59d6..128f9b21d 100644
--- a/drivers/block/paride/pd.c
+++ b/drivers/block/paride/pd.c
@@ -208,6 +208,7 @@ MODULE_PARM(drive3,"1-8i");
#define DEVICE_OFF(device)
#include <linux/blk.h>
+#include <linux/blkpg.h>
#include "pseudo.h"
@@ -331,7 +332,7 @@ static int pd_dev; /* minor of current request */
static int pd_poffs; /* partition offset of current minor */
static char * pd_buf; /* buffer for request in progress */
-static struct wait_queue *pd_wait_open = NULL;
+static DECLARE_WAIT_QUEUE_HEAD(pd_wait_open);
static char *pd_errs[17] = { "ERR","INDEX","ECC","DRQ","SEEK","WRERR",
"READY","BUSY","AMNF","TK0NF","ABRT","MCR",
@@ -483,35 +484,23 @@ static int pd_ioctl(struct inode *inode,struct file *file,
}
put_user(pd_hd[dev].start_sect,(long *)&geo->start);
return 0;
- case BLKRASET:
- if(!capable(CAP_SYS_ADMIN)) return -EACCES;
- if(!(inode->i_rdev)) return -EINVAL;
- if(arg > 0xff) return -EINVAL;
- read_ahead[MAJOR(inode->i_rdev)] = arg;
- return 0;
- case BLKRAGET:
- if (!arg) return -EINVAL;
- err = verify_area(VERIFY_WRITE,(long *) arg,sizeof(long));
- if (err) return (err);
- put_user(read_ahead[MAJOR(inode->i_rdev)],(long *) arg);
- return (0);
case BLKGETSIZE:
if (!arg) return -EINVAL;
err = verify_area(VERIFY_WRITE,(long *) arg,sizeof(long));
if (err) return (err);
put_user(pd_hd[dev].nr_sects,(long *) arg);
return (0);
- case BLKFLSBUF:
- if(!capable(CAP_SYS_ADMIN)) return -EACCES;
- if(!(inode->i_rdev)) return -EINVAL;
- fsync_dev(inode->i_rdev);
- invalidate_buffers(inode->i_rdev);
- return 0;
case BLKRRPART:
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
return pd_revalidate(inode->i_rdev);
- RO_IOCTLS(inode->i_rdev,arg);
+ case BLKROSET:
+ case BLKROGET:
+ case BLKRASET:
+ case BLKRAGET:
+ case BLKFLSBUF:
+ case BLKPG:
+ return blk_ioctl(inode->i_rdev, cmd, arg);
default:
return -EINVAL;
}
diff --git a/drivers/block/paride/pf.c b/drivers/block/paride/pf.c
index 255352f0a..f1cdfe3c6 100644
--- a/drivers/block/paride/pf.c
+++ b/drivers/block/paride/pf.c
@@ -205,6 +205,7 @@ MODULE_PARM(drive3,"1-7i");
#define DEVICE_OFF(device)
#include <linux/blk.h>
+#include <linux/blkpg.h>
#include "pseudo.h"
@@ -433,31 +434,18 @@ static int pf_ioctl(struct inode *inode,struct file *file,
}
put_user(0,(long *)&geo->start);
return 0;
- case BLKRASET:
- if(!capable(CAP_SYS_ADMIN)) return -EACCES;
- if(!(inode->i_rdev)) return -EINVAL;
- if(arg > 0xff) return -EINVAL;
- read_ahead[MAJOR(inode->i_rdev)] = arg;
- return 0;
- case BLKRAGET:
- if (!arg) return -EINVAL;
- err = verify_area(VERIFY_WRITE,(long *) arg,sizeof(long));
- if (err) return (err);
- put_user(read_ahead[MAJOR(inode->i_rdev)],(long *) arg);
- return (0);
case BLKGETSIZE:
if (!arg) return -EINVAL;
err = verify_area(VERIFY_WRITE,(long *) arg,sizeof(long));
if (err) return (err);
put_user(PF.capacity,(long *) arg);
return (0);
- case BLKFLSBUF:
- if(!capable(CAP_SYS_ADMIN)) return -EACCES;
- if(!(inode->i_rdev)) return -EINVAL;
- fsync_dev(inode->i_rdev);
- invalidate_buffers(inode->i_rdev);
- return 0;
- RO_IOCTLS(inode->i_rdev,arg);
+ case BLKROSET:
+ case BLKROGET:
+ case BLKRASET:
+ case BLKRAGET:
+ case BLKFLSBUF:
+ return blk_ioctl(inode->i_rdev, cmd, arg);
default:
return -EINVAL;
}