Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 205
b: refs/heads/master
c: b665112
h: refs/heads/master
i:
  203: 1034f2a
v: v3
  • Loading branch information
unknown authored and James Bottomley committed Apr 18, 2005
1 parent 3353774 commit 6c93bf3
Show file tree
Hide file tree
Showing 18 changed files with 298 additions and 202 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c2a9331c62216e222a08de8dd58559367fef0af6
refs/heads/master: b6651129cc27d56a9cbefcb5f713cea7706fd6b7
9 changes: 0 additions & 9 deletions trunk/drivers/block/ll_rw_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1715,15 +1715,6 @@ request_queue_t *blk_init_queue(request_fn_proc *rfn, spinlock_t *lock)
if (blk_init_free_list(q))
goto out_init;

/*
* if caller didn't supply a lock, they get per-queue locking with
* our embedded lock
*/
if (!lock) {
spin_lock_init(&q->__queue_lock);
lock = &q->__queue_lock;
}

q->request_fn = rfn;
q->back_merge_fn = ll_back_merge_fn;
q->front_merge_fn = ll_front_merge_fn;
Expand Down
5 changes: 0 additions & 5 deletions trunk/drivers/block/scsi_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,11 +328,6 @@ static int sg_io(struct file *file, request_queue_t *q,
return 0;
}

#define FORMAT_UNIT_TIMEOUT (2 * 60 * 60 * HZ)
#define START_STOP_TIMEOUT (60 * HZ)
#define MOVE_MEDIUM_TIMEOUT (5 * 60 * HZ)
#define READ_ELEMENT_STATUS_TIMEOUT (5 * 60 * HZ)
#define READ_DEFECT_DATA_TIMEOUT (60 * HZ )
#define OMAX_SB_LEN 16 /* For backward compatibility */

static int sg_scsi_ioctl(struct file *file, request_queue_t *q,
Expand Down
34 changes: 22 additions & 12 deletions trunk/drivers/s390/scsi/zfcp_aux.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,19 @@ static inline int zfcp_sg_list_copy_from_user(struct zfcp_sg_list *,
static inline int zfcp_sg_list_copy_to_user(void __user *,
struct zfcp_sg_list *, size_t);

static int zfcp_cfdc_dev_ioctl(struct file *, unsigned int, unsigned long);
static int zfcp_cfdc_dev_ioctl(struct inode *, struct file *,
unsigned int, unsigned long);

#define ZFCP_CFDC_IOC_MAGIC 0xDD
#define ZFCP_CFDC_IOC \
_IOWR(ZFCP_CFDC_IOC_MAGIC, 0, struct zfcp_cfdc_sense_data)


static struct file_operations zfcp_cfdc_fops = {
.unlocked_ioctl = zfcp_cfdc_dev_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = zfcp_cfdc_dev_ioctl
static struct ioctl_trans zfcp_ioctl_trans = {ZFCP_CFDC_IOC, (void*) sys_ioctl};
#endif

static struct file_operations zfcp_cfdc_fops = {
.ioctl = zfcp_cfdc_dev_ioctl
};

static struct miscdevice zfcp_cfdc_misc = {
Expand Down Expand Up @@ -307,16 +308,23 @@ zfcp_module_init(void)
if (!zfcp_transport_template)
return -ENODEV;

retval = register_ioctl32_conversion(zfcp_ioctl_trans.cmd,
zfcp_ioctl_trans.handler);
if (retval != 0) {
ZFCP_LOG_INFO("registration of ioctl32 conversion failed\n");
goto out;
}

retval = misc_register(&zfcp_cfdc_misc);
if (retval != 0) {
ZFCP_LOG_INFO("registration of misc device "
"zfcp_cfdc failed\n");
goto out;
goto out_misc_register;
} else {
ZFCP_LOG_TRACE("major/minor for zfcp_cfdc: %d/%d\n",
ZFCP_CFDC_DEV_MAJOR, zfcp_cfdc_misc.minor);
}

ZFCP_LOG_TRACE("major/minor for zfcp_cfdc: %d/%d\n",
ZFCP_CFDC_DEV_MAJOR, zfcp_cfdc_misc.minor);

/* Initialise proc semaphores */
sema_init(&zfcp_data.config_sema, 1);

Expand All @@ -340,6 +348,8 @@ zfcp_module_init(void)

out_ccw_register:
misc_deregister(&zfcp_cfdc_misc);
out_misc_register:
unregister_ioctl32_conversion(zfcp_ioctl_trans.cmd);
out:
return retval;
}
Expand All @@ -360,9 +370,9 @@ zfcp_module_init(void)
* -EPERM - Cannot create or queue FSF request or create SBALs
* -ERESTARTSYS- Received signal (is mapped to EAGAIN by VFS)
*/
static long
zfcp_cfdc_dev_ioctl(struct file *file, unsigned int command,
unsigned long buffer)
static int
zfcp_cfdc_dev_ioctl(struct inode *inode, struct file *file,
unsigned int command, unsigned long buffer)
{
struct zfcp_cfdc_sense_data *sense_data, __user *sense_data_user;
struct zfcp_adapter *adapter = NULL;
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/scsi/53c700.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,8 @@ NCR_700_detect(struct scsi_host_template *tpnt,
host->max_lun = NCR_700_MAX_LUNS;
BUG_ON(NCR_700_transport_template == NULL);
host->transportt = NCR_700_transport_template;
host->unique_id = (unsigned long)hostdata->base;
host->unique_id = hostdata->base;
host->base = hostdata->base;
hostdata->eh_complete = NULL;
host->hostdata[0] = (unsigned long)hostdata;
/* kick the chip */
Expand Down
192 changes: 172 additions & 20 deletions trunk/drivers/scsi/53c700.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
#include <scsi/scsi_device.h>


#if defined(CONFIG_53C700_MEM_MAPPED) && defined(CONFIG_53C700_IO_MAPPED)
#define CONFIG_53C700_BOTH_MAPPED
#endif

/* Turn on for general debugging---too verbose for normal use */
#undef NCR_700_DEBUG
/* Debug the tag queues, checking hash queue allocation and deallocation
Expand Down Expand Up @@ -45,6 +49,13 @@
/* magic byte identifying an internally generated REQUEST_SENSE command */
#define NCR_700_INTERNAL_SENSE_MAGIC 0x42

/* WARNING: Leave this in for now: the dependency preprocessor doesn't
* pick up file specific flags, so must define here if they are not
* set */
#if !defined(CONFIG_53C700_IO_MAPPED) && !defined(CONFIG_53C700_MEM_MAPPED)
#error "Config.in must define either CONFIG_53C700_IO_MAPPED or CONFIG_53C700_MEM_MAPPED to use this scsi core."
#endif

struct NCR_700_Host_Parameters;

/* These are the externally used routines */
Expand Down Expand Up @@ -173,7 +184,7 @@ struct NCR_700_command_slot {
struct NCR_700_Host_Parameters {
/* These must be filled in by the calling driver */
int clock; /* board clock speed in MHz */
void __iomem *base; /* the base for the port (copied to host) */
unsigned long base; /* the base for the port (copied to host) */
struct device *dev;
__u32 dmode_extra; /* adjustable bus settings */
__u32 differential:1; /* if we are differential */
Expand All @@ -188,6 +199,9 @@ struct NCR_700_Host_Parameters {
/* NOTHING BELOW HERE NEEDS ALTERING */
__u32 fast:1; /* if we can alter the SCSI bus clock
speed (so can negiotiate sync) */
#ifdef CONFIG_53C700_BOTH_MAPPED
__u32 mem_mapped; /* set if memory mapped */
#endif
int sync_clock; /* The speed of the SYNC core */

__u32 *script; /* pointer to script location */
Expand Down Expand Up @@ -232,18 +246,12 @@ struct NCR_700_Host_Parameters {
#ifdef CONFIG_53C700_LE_ON_BE
#define bE (hostdata->force_le_on_be ? 0 : 3)
#define bSWAP (hostdata->force_le_on_be)
/* This is terrible, but there's no raw version of ioread32. That means
* that on a be board we swap twice (once in ioread32 and once again to
* get the value correct) */
#define bS_to_io(x) ((hostdata->force_le_on_be) ? (x) : cpu_to_le32(x))
#elif defined(__BIG_ENDIAN)
#define bE 3
#define bSWAP 0
#define bS_to_io(x) (x)
#elif defined(__LITTLE_ENDIAN)
#define bE 0
#define bSWAP 0
#define bS_to_io(x) (x)
#else
#error "__BIG_ENDIAN or __LITTLE_ENDIAN must be defined, did you include byteorder.h?"
#endif
Expand Down Expand Up @@ -447,42 +455,91 @@ struct NCR_700_Host_Parameters {


static inline __u8
NCR_700_readb(struct Scsi_Host *host, __u32 reg)
NCR_700_mem_readb(struct Scsi_Host *host, __u32 reg)
{
const struct NCR_700_Host_Parameters *hostdata
const struct NCR_700_Host_Parameters *hostdata __attribute__((unused))
= (struct NCR_700_Host_Parameters *)host->hostdata[0];

return ioread8(hostdata->base + (reg^bE));
return readb(host->base + (reg^bE));
}

static inline __u32
NCR_700_readl(struct Scsi_Host *host, __u32 reg)
NCR_700_mem_readl(struct Scsi_Host *host, __u32 reg)
{
const struct NCR_700_Host_Parameters *hostdata
__u32 value = __raw_readl(host->base + reg);
const struct NCR_700_Host_Parameters *hostdata __attribute__((unused))
= (struct NCR_700_Host_Parameters *)host->hostdata[0];
__u32 value = ioread32(hostdata->base + reg);
#if 1
/* sanity check the register */
if((reg & 0x3) != 0)
BUG();
#endif

return bS_to_io(value);
return bS_to_cpu(value);
}

static inline void
NCR_700_writeb(__u8 value, struct Scsi_Host *host, __u32 reg)
NCR_700_mem_writeb(__u8 value, struct Scsi_Host *host, __u32 reg)
{
const struct NCR_700_Host_Parameters *hostdata
const struct NCR_700_Host_Parameters *hostdata __attribute__((unused))
= (struct NCR_700_Host_Parameters *)host->hostdata[0];

iowrite8(value, hostdata->base + (reg^bE));
writeb(value, host->base + (reg^bE));
}

static inline void
NCR_700_writel(__u32 value, struct Scsi_Host *host, __u32 reg)
NCR_700_mem_writel(__u32 value, struct Scsi_Host *host, __u32 reg)
{
const struct NCR_700_Host_Parameters *hostdata __attribute__((unused))
= (struct NCR_700_Host_Parameters *)host->hostdata[0];

#if 1
/* sanity check the register */
if((reg & 0x3) != 0)
BUG();
#endif

__raw_writel(bS_to_host(value), host->base + reg);
}

static inline __u8
NCR_700_io_readb(struct Scsi_Host *host, __u32 reg)
{
const struct NCR_700_Host_Parameters *hostdata __attribute__((unused))
= (struct NCR_700_Host_Parameters *)host->hostdata[0];

return inb(host->base + (reg^bE));
}

static inline __u32
NCR_700_io_readl(struct Scsi_Host *host, __u32 reg)
{
__u32 value = inl(host->base + reg);
const struct NCR_700_Host_Parameters *hostdata __attribute__((unused))
= (struct NCR_700_Host_Parameters *)host->hostdata[0];

#if 1
/* sanity check the register */
if((reg & 0x3) != 0)
BUG();
#endif

return bS_to_cpu(value);
}

static inline void
NCR_700_io_writeb(__u8 value, struct Scsi_Host *host, __u32 reg)
{
const struct NCR_700_Host_Parameters *hostdata __attribute__((unused))
= (struct NCR_700_Host_Parameters *)host->hostdata[0];

outb(value, host->base + (reg^bE));
}

static inline void
NCR_700_io_writel(__u32 value, struct Scsi_Host *host, __u32 reg)
{
const struct NCR_700_Host_Parameters *hostdata
const struct NCR_700_Host_Parameters *hostdata __attribute__((unused))
= (struct NCR_700_Host_Parameters *)host->hostdata[0];

#if 1
Expand All @@ -491,7 +548,102 @@ NCR_700_writel(__u32 value, struct Scsi_Host *host, __u32 reg)
BUG();
#endif

iowrite32(bS_to_io(value), hostdata->base + reg);
outl(bS_to_host(value), host->base + reg);
}

#ifdef CONFIG_53C700_BOTH_MAPPED

static inline __u8
NCR_700_readb(struct Scsi_Host *host, __u32 reg)
{
__u8 val;

const struct NCR_700_Host_Parameters *hostdata __attribute__((unused))
= (struct NCR_700_Host_Parameters *)host->hostdata[0];

if(hostdata->mem_mapped)
val = NCR_700_mem_readb(host, reg);
else
val = NCR_700_io_readb(host, reg);

return val;
}

static inline __u32
NCR_700_readl(struct Scsi_Host *host, __u32 reg)
{
__u32 val;

const struct NCR_700_Host_Parameters *hostdata __attribute__((unused))
= (struct NCR_700_Host_Parameters *)host->hostdata[0];

if(hostdata->mem_mapped)
val = NCR_700_mem_readl(host, reg);
else
val = NCR_700_io_readl(host, reg);

return val;
}

static inline void
NCR_700_writeb(__u8 value, struct Scsi_Host *host, __u32 reg)
{
const struct NCR_700_Host_Parameters *hostdata __attribute__((unused))
= (struct NCR_700_Host_Parameters *)host->hostdata[0];

if(hostdata->mem_mapped)
NCR_700_mem_writeb(value, host, reg);
else
NCR_700_io_writeb(value, host, reg);
}

static inline void
NCR_700_writel(__u32 value, struct Scsi_Host *host, __u32 reg)
{
const struct NCR_700_Host_Parameters *hostdata __attribute__((unused))
= (struct NCR_700_Host_Parameters *)host->hostdata[0];

if(hostdata->mem_mapped)
NCR_700_mem_writel(value, host, reg);
else
NCR_700_io_writel(value, host, reg);
}

static inline void
NCR_700_set_mem_mapped(struct NCR_700_Host_Parameters *hostdata)
{
hostdata->mem_mapped = 1;
}

static inline void
NCR_700_set_io_mapped(struct NCR_700_Host_Parameters *hostdata)
{
hostdata->mem_mapped = 0;
}


#elif defined(CONFIG_53C700_IO_MAPPED)

#define NCR_700_readb NCR_700_io_readb
#define NCR_700_readl NCR_700_io_readl
#define NCR_700_writeb NCR_700_io_writeb
#define NCR_700_writel NCR_700_io_writel

#define NCR_700_set_io_mapped(x)
#define NCR_700_set_mem_mapped(x) error I/O mapped only

#elif defined(CONFIG_53C700_MEM_MAPPED)

#define NCR_700_readb NCR_700_mem_readb
#define NCR_700_readl NCR_700_mem_readl
#define NCR_700_writeb NCR_700_mem_writeb
#define NCR_700_writel NCR_700_mem_writel

#define NCR_700_set_io_mapped(x) error MEM mapped only
#define NCR_700_set_mem_mapped(x)

#else
#error neither CONFIG_53C700_MEM_MAPPED nor CONFIG_53C700_IO_MAPPED is set
#endif

#endif
Loading

0 comments on commit 6c93bf3

Please sign in to comment.