Commit e8f32de5 authored by Mark Haverkamp's avatar Mark Haverkamp Committed by James Bottomley

[SCSI] aacraid: rework packet support code

Received from Mark Salyzyn,

Replace all if/else packet formations with platform function calls. This is in
recognition of the proliferation of read and write packet types, and in the
need to migrate to up-and-coming packets for new products.

Signed-off-by Mark Haverkamp <markh@linux-foundation.org>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 239eab19
This diff is collapsed.
...@@ -486,6 +486,7 @@ enum aac_log_level { ...@@ -486,6 +486,7 @@ enum aac_log_level {
struct aac_dev; struct aac_dev;
struct fib; struct fib;
struct scsi_cmnd;
struct adapter_ops struct adapter_ops
{ {
...@@ -501,6 +502,10 @@ struct adapter_ops ...@@ -501,6 +502,10 @@ struct adapter_ops
irqreturn_t (*adapter_intr)(int irq, void *dev_id); irqreturn_t (*adapter_intr)(int irq, void *dev_id);
/* Packet operations */ /* Packet operations */
int (*adapter_deliver)(struct fib * fib); int (*adapter_deliver)(struct fib * fib);
int (*adapter_bounds)(struct aac_dev * dev, struct scsi_cmnd * cmd, u64 lba);
int (*adapter_read)(struct fib * fib, struct scsi_cmnd * cmd, u64 lba, u32 count);
int (*adapter_write)(struct fib * fib, struct scsi_cmnd * cmd, u64 lba, u32 count);
int (*adapter_scsi)(struct fib * fib, struct scsi_cmnd * cmd);
/* Administrative operations */ /* Administrative operations */
int (*adapter_comm)(struct aac_dev * dev, int comm); int (*adapter_comm)(struct aac_dev * dev, int comm);
}; };
...@@ -1061,6 +1066,18 @@ struct aac_dev ...@@ -1061,6 +1066,18 @@ struct aac_dev
#define aac_adapter_deliver(fib) \ #define aac_adapter_deliver(fib) \
((fib)->dev)->a_ops.adapter_deliver(fib) ((fib)->dev)->a_ops.adapter_deliver(fib)
#define aac_adapter_bounds(dev,cmd,lba) \
dev->a_ops.adapter_bounds(dev,cmd,lba)
#define aac_adapter_read(fib,cmd,lba,count) \
((fib)->dev)->a_ops.adapter_read(fib,cmd,lba,count)
#define aac_adapter_write(fib,cmd,lba,count) \
((fib)->dev)->a_ops.adapter_write(fib,cmd,lba,count)
#define aac_adapter_scsi(fib,cmd) \
((fib)->dev)->a_ops.adapter_scsi(fib,cmd)
#define aac_adapter_comm(dev,comm) \ #define aac_adapter_comm(dev,comm) \
(dev)->a_ops.adapter_comm(dev, comm) (dev)->a_ops.adapter_comm(dev, comm)
...@@ -1783,7 +1800,6 @@ static inline u32 cap_to_cyls(sector_t capacity, u32 divisor) ...@@ -1783,7 +1800,6 @@ static inline u32 cap_to_cyls(sector_t capacity, u32 divisor)
return (u32)capacity; return (u32)capacity;
} }
struct scsi_cmnd;
/* SCp.phase values */ /* SCp.phase values */
#define AAC_OWNER_MIDLEVEL 0x101 #define AAC_OWNER_MIDLEVEL 0x101
#define AAC_OWNER_LOWLEVEL 0x102 #define AAC_OWNER_LOWLEVEL 0x102
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment