diff options
author | Mark Haverkamp <markh@linux-foundation.org> | 2007-01-23 17:59:20 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2007-01-27 10:27:06 -0500 |
commit | 28713324a0f3c055186ecec27239673c36ba1de5 (patch) | |
tree | aa17c4441b0fda12f1d3a9a58a374a917666b781 /drivers/scsi/aacraid/rkt.c | |
parent | 9cd065ab80d6c14c6693a93c8f47ef4cb80e770f (diff) |
[SCSI] aacraid: rework communication support code
Received from Mark Salyzyn,
Replace all if/else communication transports with a platform function call.
This is in recognition of the need to migrate to up-and-coming transports.
Currently the Linux driver does not support two available communication
transports provided by our products, these will be added in future patches, and
will expand the platform function set.
Signed-off-by Mark Haverkamp <markh@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/aacraid/rkt.c')
-rw-r--r-- | drivers/scsi/aacraid/rkt.c | 64 |
1 files changed, 36 insertions, 28 deletions
diff --git a/drivers/scsi/aacraid/rkt.c b/drivers/scsi/aacraid/rkt.c index 643f23b5ded8..d953c3fe998a 100644 --- a/drivers/scsi/aacraid/rkt.c +++ b/drivers/scsi/aacraid/rkt.c | |||
@@ -34,6 +34,40 @@ | |||
34 | 34 | ||
35 | #include "aacraid.h" | 35 | #include "aacraid.h" |
36 | 36 | ||
37 | #define AAC_NUM_IO_FIB_RKT (246 - AAC_NUM_MGT_FIB) | ||
38 | |||
39 | /** | ||
40 | * aac_rkt_select_comm - Select communications method | ||
41 | * @dev: Adapter | ||
42 | * @comm: communications method | ||
43 | */ | ||
44 | |||
45 | static int aac_rkt_select_comm(struct aac_dev *dev, int comm) | ||
46 | { | ||
47 | int retval; | ||
48 | extern int aac_rx_select_comm(struct aac_dev *dev, int comm); | ||
49 | retval = aac_rx_select_comm(dev, comm); | ||
50 | if (comm == AAC_COMM_MESSAGE) { | ||
51 | /* | ||
52 | * FIB Setup has already been done, but we can minimize the | ||
53 | * damage by at least ensuring the OS never issues more | ||
54 | * commands than we can handle. The Rocket adapters currently | ||
55 | * can only handle 246 commands and 8 AIFs at the same time, | ||
56 | * and in fact do notify us accordingly if we negotiate the | ||
57 | * FIB size. The problem that causes us to add this check is | ||
58 | * to ensure that we do not overdo it with the adapter when a | ||
59 | * hard coded FIB override is being utilized. This special | ||
60 | * case warrants this half baked, but convenient, check here. | ||
61 | */ | ||
62 | if (dev->scsi_host_ptr->can_queue > AAC_NUM_IO_FIB_RKT) { | ||
63 | dev->init->MaxIoCommands = | ||
64 | cpu_to_le32(AAC_NUM_IO_FIB_RKT + AAC_NUM_MGT_FIB); | ||
65 | dev->scsi_host_ptr->can_queue = AAC_NUM_IO_FIB_RKT; | ||
66 | } | ||
67 | } | ||
68 | return retval; | ||
69 | } | ||
70 | |||
37 | /** | 71 | /** |
38 | * aac_rkt_ioremap | 72 | * aac_rkt_ioremap |
39 | * @size: mapping resize request | 73 | * @size: mapping resize request |
@@ -63,39 +97,13 @@ static int aac_rkt_ioremap(struct aac_dev * dev, u32 size) | |||
63 | 97 | ||
64 | int aac_rkt_init(struct aac_dev *dev) | 98 | int aac_rkt_init(struct aac_dev *dev) |
65 | { | 99 | { |
66 | int retval; | ||
67 | extern int _aac_rx_init(struct aac_dev *dev); | 100 | extern int _aac_rx_init(struct aac_dev *dev); |
68 | extern void aac_rx_start_adapter(struct aac_dev *dev); | ||
69 | 101 | ||
70 | /* | 102 | /* |
71 | * Fill in the function dispatch table. | 103 | * Fill in the function dispatch table. |
72 | */ | 104 | */ |
73 | dev->a_ops.adapter_ioremap = aac_rkt_ioremap; | 105 | dev->a_ops.adapter_ioremap = aac_rkt_ioremap; |
106 | dev->a_ops.adapter_comm = aac_rkt_select_comm; | ||
74 | 107 | ||
75 | retval = _aac_rx_init(dev); | 108 | return _aac_rx_init(dev); |
76 | if (retval) | ||
77 | return retval; | ||
78 | if (dev->new_comm_interface) { | ||
79 | /* | ||
80 | * FIB Setup has already been done, but we can minimize the | ||
81 | * damage by at least ensuring the OS never issues more | ||
82 | * commands than we can handle. The Rocket adapters currently | ||
83 | * can only handle 246 commands and 8 AIFs at the same time, | ||
84 | * and in fact do notify us accordingly if we negotiate the | ||
85 | * FIB size. The problem that causes us to add this check is | ||
86 | * to ensure that we do not overdo it with the adapter when a | ||
87 | * hard coded FIB override is being utilized. This special | ||
88 | * case warrants this half baked, but convenient, check here. | ||
89 | */ | ||
90 | if (dev->scsi_host_ptr->can_queue > (246 - AAC_NUM_MGT_FIB)) { | ||
91 | dev->init->MaxIoCommands = cpu_to_le32(246); | ||
92 | dev->scsi_host_ptr->can_queue = 246 - AAC_NUM_MGT_FIB; | ||
93 | } | ||
94 | } | ||
95 | /* | ||
96 | * Tell the adapter that all is configured, and it can start | ||
97 | * accepting requests | ||
98 | */ | ||
99 | aac_rx_start_adapter(dev); | ||
100 | return 0; | ||
101 | } | 109 | } |