aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aacraid/aacraid.h
diff options
context:
space:
mode:
authorMark Haverkamp <markh@osdl.org>2005-05-16 21:28:42 -0400
committerJames Bottomley <jejb@mulgrave.(none)>2005-05-20 16:48:00 -0400
commit7c00ffa314bf0fb0e23858bbebad33b48b6abbb9 (patch)
tree4d6b65bb5a2c8fecf48a8c6402c2cc867aa2fe6c /drivers/scsi/aacraid/aacraid.h
parent672b2d38da4fff4c4452685a25fb88b65243d1a6 (diff)
[SCSI] 2.6 aacraid: Variable FIB size (updated patch)
New code from the Adaptec driver. Performance enhancement for newer adapters. I hope that this isn't too big for a single patch. I believe that other than the few small cleanups mentioned, that the changes are all related. - Added Variable FIB size negotiation for new adapters. - Added support to maximize scatter gather tables and thus permit requests larger than 64KB/each. - Limit Scatter Gather to 34 elements for ROMB platforms. - aac_printf is only enabled with AAC_QUIRK_34SG - Large FIB ioctl support - some minor cleanup Passes sparse check. I have tested it on x86 and ppc64 machines. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/aacraid/aacraid.h')
-rw-r--r--drivers/scsi/aacraid/aacraid.h70
1 files changed, 58 insertions, 12 deletions
diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
index a250a6f359b1..42484417cef7 100644
--- a/drivers/scsi/aacraid/aacraid.h
+++ b/drivers/scsi/aacraid/aacraid.h
@@ -8,12 +8,18 @@
8 8
9#define MAXIMUM_NUM_CONTAINERS 32 9#define MAXIMUM_NUM_CONTAINERS 32
10 10
11#define AAC_NUM_FIB (256 + 64) 11#define AAC_NUM_MGT_FIB 8
12#define AAC_NUM_IO_FIB 100 12#define AAC_NUM_IO_FIB (512 - AAC_NUM_MGT_FIB)
13#define AAC_NUM_FIB (AAC_NUM_IO_FIB + AAC_NUM_MGT_FIB)
13 14
14#define AAC_MAX_LUN (8) 15#define AAC_MAX_LUN (8)
15 16
16#define AAC_MAX_HOSTPHYSMEMPAGES (0xfffff) 17#define AAC_MAX_HOSTPHYSMEMPAGES (0xfffff)
18/*
19 * max_sectors is an unsigned short, otherwise limit is 0x100000000 / 512
20 * Linux has starvation problems if we permit larger than 4MB I/O ...
21 */
22#define AAC_MAX_32BIT_SGBCOUNT ((unsigned short)8192)
17 23
18/* 24/*
19 * These macros convert from physical channels to virtual channels 25 * These macros convert from physical channels to virtual channels
@@ -303,12 +309,9 @@ struct aac_fibhdr {
303 } _u; 309 } _u;
304}; 310};
305 311
306#define FIB_DATA_SIZE_IN_BYTES (512 - sizeof(struct aac_fibhdr))
307
308
309struct hw_fib { 312struct hw_fib {
310 struct aac_fibhdr header; 313 struct aac_fibhdr header;
311 u8 data[FIB_DATA_SIZE_IN_BYTES]; // Command specific data 314 u8 data[512-sizeof(struct aac_fibhdr)]; // Command specific data
312}; 315};
313 316
314/* 317/*
@@ -370,11 +373,12 @@ struct hw_fib {
370#define RequestAdapterInfo 703 373#define RequestAdapterInfo 703
371#define IsAdapterPaused 704 374#define IsAdapterPaused 704
372#define SendHostTime 705 375#define SendHostTime 705
373#define LastMiscCommand 706 376#define RequestSupplementAdapterInfo 706
377#define LastMiscCommand 707
374 378
375// 379/*
376// Commands that will target the failover level on the FSA adapter 380 * Commands that will target the failover level on the FSA adapter
377// 381 */
378 382
379enum fib_xfer_state { 383enum fib_xfer_state {
380 HostOwned = (1<<0), 384 HostOwned = (1<<0),
@@ -407,6 +411,7 @@ enum fib_xfer_state {
407 */ 411 */
408 412
409#define ADAPTER_INIT_STRUCT_REVISION 3 413#define ADAPTER_INIT_STRUCT_REVISION 3
414#define ADAPTER_INIT_STRUCT_REVISION_4 4 // rocket science
410 415
411struct aac_init 416struct aac_init
412{ 417{
@@ -424,6 +429,14 @@ struct aac_init
424 __le32 HostPhysMemPages; /* number of 4k pages of host 429 __le32 HostPhysMemPages; /* number of 4k pages of host
425 physical memory */ 430 physical memory */
426 __le32 HostElapsedSeconds; /* number of seconds since 1970. */ 431 __le32 HostElapsedSeconds; /* number of seconds since 1970. */
432 /*
433 * ADAPTER_INIT_STRUCT_REVISION_4 begins here
434 */
435 __le32 InitFlags; /* flags for supported features */
436#define INITFLAGS_NEW_COMM_SUPPORTED 0x00000001
437 __le32 MaxIoCommands; /* max outstanding commands */
438 __le32 MaxIoSize; /* largest I/O command */
439 __le32 MaxFibSize; /* largest FIB to adapter */
427}; 440};
428 441
429enum aac_log_level { 442enum aac_log_level {
@@ -447,7 +460,7 @@ struct adapter_ops
447{ 460{
448 void (*adapter_interrupt)(struct aac_dev *dev); 461 void (*adapter_interrupt)(struct aac_dev *dev);
449 void (*adapter_notify)(struct aac_dev *dev, u32 event); 462 void (*adapter_notify)(struct aac_dev *dev, u32 event);
450 int (*adapter_sync_cmd)(struct aac_dev *dev, u32 command, u32 p1, u32 *status); 463 int (*adapter_sync_cmd)(struct aac_dev *dev, u32 command, u32 p1, u32 p2, u32 p3, u32 p4, u32 p5, u32 p6, u32 *status, u32 *r1, u32 *r2, u32 *r3, u32 *r4);
451 int (*adapter_check_health)(struct aac_dev *dev); 464 int (*adapter_check_health)(struct aac_dev *dev);
452}; 465};
453 466
@@ -567,6 +580,7 @@ struct sa_drawbridge_CSR {
567#define Mailbox3 SaDbCSR.MAILBOX3 580#define Mailbox3 SaDbCSR.MAILBOX3
568#define Mailbox4 SaDbCSR.MAILBOX4 581#define Mailbox4 SaDbCSR.MAILBOX4
569#define Mailbox5 SaDbCSR.MAILBOX5 582#define Mailbox5 SaDbCSR.MAILBOX5
583#define Mailbox6 SaDbCSR.MAILBOX6
570#define Mailbox7 SaDbCSR.MAILBOX7 584#define Mailbox7 SaDbCSR.MAILBOX7
571 585
572#define DoorbellReg_p SaDbCSR.PRISETIRQ 586#define DoorbellReg_p SaDbCSR.PRISETIRQ
@@ -812,6 +826,25 @@ struct aac_adapter_info
812 __le32 OEM; 826 __le32 OEM;
813}; 827};
814 828
829struct aac_supplement_adapter_info
830{
831 u8 AdapterTypeText[17+1];
832 u8 Pad[2];
833 __le32 FlashMemoryByteSize;
834 __le32 FlashImageId;
835 __le32 MaxNumberPorts;
836 __le32 Version;
837 __le32 FeatureBits;
838 u8 SlotNumber;
839 u8 ReservedPad0[0];
840 u8 BuildDate[12];
841 __le32 CurrentNumberPorts;
842 __le32 ReservedGrowth[24];
843};
844#define AAC_FEATURE_FALCON 0x00000010
845#define AAC_SIS_VERSION_V3 3
846#define AAC_SIS_SLOT_UNKNOWN 0xFF
847
815/* 848/*
816 * Battery platforms 849 * Battery platforms
817 */ 850 */
@@ -857,6 +890,12 @@ struct aac_dev
857 890
858 u16 irq_mask; 891 u16 irq_mask;
859 /* 892 /*
893 * negotiated FIB settings
894 */
895 unsigned max_fib_size;
896 unsigned sg_tablesize;
897
898 /*
860 * Map for 128 fib objects (64k) 899 * Map for 128 fib objects (64k)
861 */ 900 */
862 dma_addr_t hw_fib_pa; 901 dma_addr_t hw_fib_pa;
@@ -915,12 +954,14 @@ struct aac_dev
915 u32 aif_thread; 954 u32 aif_thread;
916 struct completion aif_completion; 955 struct completion aif_completion;
917 struct aac_adapter_info adapter_info; 956 struct aac_adapter_info adapter_info;
957 struct aac_supplement_adapter_info supplement_adapter_info;
918 /* These are in adapter info but they are in the io flow so 958 /* These are in adapter info but they are in the io flow so
919 * lets break them out so we don't have to do an AND to check them 959 * lets break them out so we don't have to do an AND to check them
920 */ 960 */
921 u8 nondasd_support; 961 u8 nondasd_support;
922 u8 dac_support; 962 u8 dac_support;
923 u8 raid_scsi_mode; 963 u8 raid_scsi_mode;
964 u8 printf_enabled;
924}; 965};
925 966
926#define aac_adapter_interrupt(dev) \ 967#define aac_adapter_interrupt(dev) \
@@ -929,6 +970,8 @@ struct aac_dev
929#define aac_adapter_notify(dev, event) \ 970#define aac_adapter_notify(dev, event) \
930 (dev)->a_ops.adapter_notify(dev, event) 971 (dev)->a_ops.adapter_notify(dev, event)
931 972
973#define aac_adapter_sync_cmd(dev, command, p1, p2, p3, p4, p5, p6, status, r1, r2, r3, r4) \
974 (dev)->a_ops.adapter_sync_cmd(dev, command, p1, p2, p3, p4, p5, p6, status, r1, r2, r3, r4)
932 975
933#define aac_adapter_check_health(dev) \ 976#define aac_adapter_check_health(dev) \
934 (dev)->a_ops.adapter_check_health(dev) 977 (dev)->a_ops.adapter_check_health(dev)
@@ -1327,7 +1370,7 @@ struct aac_commit_config {
1327}; 1370};
1328 1371
1329/* 1372/*
1330 * Query for Container Configuration Count 1373 * Query for Container Configuration Status
1331 */ 1374 */
1332 1375
1333#define CT_GET_CONTAINER_COUNT 4 1376#define CT_GET_CONTAINER_COUNT 4
@@ -1481,6 +1524,7 @@ struct revision
1481#define FSACTL_GET_PCI_INFO CTL_CODE(2119, METHOD_BUFFERED) 1524#define FSACTL_GET_PCI_INFO CTL_CODE(2119, METHOD_BUFFERED)
1482#define FSACTL_FORCE_DELETE_DISK CTL_CODE(2120, METHOD_NEITHER) 1525#define FSACTL_FORCE_DELETE_DISK CTL_CODE(2120, METHOD_NEITHER)
1483#define FSACTL_GET_CONTAINERS 2131 1526#define FSACTL_GET_CONTAINERS 2131
1527#define FSACTL_SEND_LARGE_FIB CTL_CODE(2138, METHOD_BUFFERED)
1484 1528
1485 1529
1486struct aac_common 1530struct aac_common
@@ -1667,3 +1711,5 @@ int fib_adapter_complete(struct fib * fibptr, unsigned short size);
1667struct aac_driver_ident* aac_get_driver_ident(int devtype); 1711struct aac_driver_ident* aac_get_driver_ident(int devtype);
1668int aac_get_adapter_info(struct aac_dev* dev); 1712int aac_get_adapter_info(struct aac_dev* dev);
1669int aac_send_shutdown(struct aac_dev *dev); 1713int aac_send_shutdown(struct aac_dev *dev);
1714extern int numacb;
1715extern int acbsize;