Andrew Vasquez | fa90c54 | 2005-10-27 11:10:08 -0700 | [diff] [blame] | 1 | /* |
| 2 | * QLogic Fibre Channel HBA Driver |
Andrew Vasquez | 01e58d8 | 2008-04-03 13:13:13 -0700 | [diff] [blame] | 3 | * Copyright (c) 2003-2008 QLogic Corporation |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | * |
Andrew Vasquez | fa90c54 | 2005-10-27 11:10:08 -0700 | [diff] [blame] | 5 | * See LICENSE.qla2xxx for copyright and licensing details. |
| 6 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | #include "qla_def.h" |
| 8 | |
| 9 | #include <linux/blkdev.h> |
| 10 | #include <linux/delay.h> |
| 11 | |
| 12 | #include <scsi/scsi_tcq.h> |
| 13 | |
Anirban Chakraborty | 73208df | 2008-12-09 16:45:39 -0800 | [diff] [blame] | 14 | static request_t *qla2x00_req_pkt(struct scsi_qla_host *, struct req_que *, |
| 15 | struct rsp_que *rsp); |
| 16 | static void qla2x00_isp_cmd(struct scsi_qla_host *, struct req_que *); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | |
| 18 | /** |
| 19 | * qla2x00_get_cmd_direction() - Determine control_flag data direction. |
| 20 | * @cmd: SCSI command |
| 21 | * |
| 22 | * Returns the proper CF_* direction based on CDB. |
| 23 | */ |
| 24 | static inline uint16_t |
Harish Zunjarrao | 49fd462 | 2008-09-11 21:22:47 -0700 | [diff] [blame] | 25 | qla2x00_get_cmd_direction(srb_t *sp) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | { |
| 27 | uint16_t cflags; |
| 28 | |
| 29 | cflags = 0; |
| 30 | |
| 31 | /* Set transfer direction */ |
Harish Zunjarrao | 49fd462 | 2008-09-11 21:22:47 -0700 | [diff] [blame] | 32 | if (sp->cmd->sc_data_direction == DMA_TO_DEVICE) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | cflags = CF_WRITE; |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 34 | sp->fcport->vha->hw->qla_stats.output_bytes += |
Harish Zunjarrao | 49fd462 | 2008-09-11 21:22:47 -0700 | [diff] [blame] | 35 | scsi_bufflen(sp->cmd); |
| 36 | } else if (sp->cmd->sc_data_direction == DMA_FROM_DEVICE) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | cflags = CF_READ; |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 38 | sp->fcport->vha->hw->qla_stats.input_bytes += |
Harish Zunjarrao | 49fd462 | 2008-09-11 21:22:47 -0700 | [diff] [blame] | 39 | scsi_bufflen(sp->cmd); |
| 40 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | return (cflags); |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * qla2x00_calc_iocbs_32() - Determine number of Command Type 2 and |
| 46 | * Continuation Type 0 IOCBs to allocate. |
| 47 | * |
| 48 | * @dsds: number of data segment decriptors needed |
| 49 | * |
| 50 | * Returns the number of IOCB entries needed to store @dsds. |
| 51 | */ |
| 52 | uint16_t |
| 53 | qla2x00_calc_iocbs_32(uint16_t dsds) |
| 54 | { |
| 55 | uint16_t iocbs; |
| 56 | |
| 57 | iocbs = 1; |
| 58 | if (dsds > 3) { |
| 59 | iocbs += (dsds - 3) / 7; |
| 60 | if ((dsds - 3) % 7) |
| 61 | iocbs++; |
| 62 | } |
| 63 | return (iocbs); |
| 64 | } |
| 65 | |
| 66 | /** |
| 67 | * qla2x00_calc_iocbs_64() - Determine number of Command Type 3 and |
| 68 | * Continuation Type 1 IOCBs to allocate. |
| 69 | * |
| 70 | * @dsds: number of data segment decriptors needed |
| 71 | * |
| 72 | * Returns the number of IOCB entries needed to store @dsds. |
| 73 | */ |
| 74 | uint16_t |
| 75 | qla2x00_calc_iocbs_64(uint16_t dsds) |
| 76 | { |
| 77 | uint16_t iocbs; |
| 78 | |
| 79 | iocbs = 1; |
| 80 | if (dsds > 2) { |
| 81 | iocbs += (dsds - 2) / 5; |
| 82 | if ((dsds - 2) % 5) |
| 83 | iocbs++; |
| 84 | } |
| 85 | return (iocbs); |
| 86 | } |
| 87 | |
| 88 | /** |
| 89 | * qla2x00_prep_cont_type0_iocb() - Initialize a Continuation Type 0 IOCB. |
| 90 | * @ha: HA context |
| 91 | * |
| 92 | * Returns a pointer to the Continuation Type 0 IOCB packet. |
| 93 | */ |
| 94 | static inline cont_entry_t * |
Anirban Chakraborty | 73208df | 2008-12-09 16:45:39 -0800 | [diff] [blame] | 95 | qla2x00_prep_cont_type0_iocb(struct req_que *req, struct scsi_qla_host *vha) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 96 | { |
| 97 | cont_entry_t *cont_pkt; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 98 | /* Adjust ring index. */ |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 99 | req->ring_index++; |
| 100 | if (req->ring_index == req->length) { |
| 101 | req->ring_index = 0; |
| 102 | req->ring_ptr = req->ring; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 103 | } else { |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 104 | req->ring_ptr++; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 105 | } |
| 106 | |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 107 | cont_pkt = (cont_entry_t *)req->ring_ptr; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 108 | |
| 109 | /* Load packet defaults. */ |
| 110 | *((uint32_t *)(&cont_pkt->entry_type)) = |
| 111 | __constant_cpu_to_le32(CONTINUE_TYPE); |
| 112 | |
| 113 | return (cont_pkt); |
| 114 | } |
| 115 | |
| 116 | /** |
| 117 | * qla2x00_prep_cont_type1_iocb() - Initialize a Continuation Type 1 IOCB. |
| 118 | * @ha: HA context |
| 119 | * |
| 120 | * Returns a pointer to the continuation type 1 IOCB packet. |
| 121 | */ |
| 122 | static inline cont_a64_entry_t * |
Anirban Chakraborty | 73208df | 2008-12-09 16:45:39 -0800 | [diff] [blame] | 123 | qla2x00_prep_cont_type1_iocb(struct req_que *req, scsi_qla_host_t *vha) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 124 | { |
| 125 | cont_a64_entry_t *cont_pkt; |
| 126 | |
| 127 | /* Adjust ring index. */ |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 128 | req->ring_index++; |
| 129 | if (req->ring_index == req->length) { |
| 130 | req->ring_index = 0; |
| 131 | req->ring_ptr = req->ring; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 132 | } else { |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 133 | req->ring_ptr++; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 134 | } |
| 135 | |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 136 | cont_pkt = (cont_a64_entry_t *)req->ring_ptr; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 137 | |
| 138 | /* Load packet defaults. */ |
| 139 | *((uint32_t *)(&cont_pkt->entry_type)) = |
| 140 | __constant_cpu_to_le32(CONTINUE_A64_TYPE); |
| 141 | |
| 142 | return (cont_pkt); |
| 143 | } |
| 144 | |
| 145 | /** |
| 146 | * qla2x00_build_scsi_iocbs_32() - Build IOCB command utilizing 32bit |
| 147 | * capable IOCB types. |
| 148 | * |
| 149 | * @sp: SRB command to process |
| 150 | * @cmd_pkt: Command type 2 IOCB |
| 151 | * @tot_dsds: Total number of segments to transfer |
| 152 | */ |
| 153 | void qla2x00_build_scsi_iocbs_32(srb_t *sp, cmd_entry_t *cmd_pkt, |
| 154 | uint16_t tot_dsds) |
| 155 | { |
| 156 | uint16_t avail_dsds; |
| 157 | uint32_t *cur_dsd; |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 158 | scsi_qla_host_t *vha; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 159 | struct scsi_cmnd *cmd; |
FUJITA Tomonori | 385d70b | 2007-05-26 01:55:38 +0900 | [diff] [blame] | 160 | struct scatterlist *sg; |
| 161 | int i; |
Anirban Chakraborty | 73208df | 2008-12-09 16:45:39 -0800 | [diff] [blame] | 162 | struct req_que *req; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 163 | |
| 164 | cmd = sp->cmd; |
| 165 | |
| 166 | /* Update entry type to indicate Command Type 2 IOCB */ |
| 167 | *((uint32_t *)(&cmd_pkt->entry_type)) = |
| 168 | __constant_cpu_to_le32(COMMAND_TYPE); |
| 169 | |
| 170 | /* No data transfer */ |
FUJITA Tomonori | 385d70b | 2007-05-26 01:55:38 +0900 | [diff] [blame] | 171 | if (!scsi_bufflen(cmd) || cmd->sc_data_direction == DMA_NONE) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 172 | cmd_pkt->byte_count = __constant_cpu_to_le32(0); |
| 173 | return; |
| 174 | } |
| 175 | |
Andrew Vasquez | 444786d | 2009-01-05 11:18:10 -0800 | [diff] [blame] | 176 | vha = sp->fcport->vha; |
Anirban Chakraborty | 17d9863 | 2008-12-18 10:06:15 -0800 | [diff] [blame] | 177 | req = sp->que; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 178 | |
Harish Zunjarrao | 49fd462 | 2008-09-11 21:22:47 -0700 | [diff] [blame] | 179 | cmd_pkt->control_flags |= cpu_to_le16(qla2x00_get_cmd_direction(sp)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 180 | |
| 181 | /* Three DSDs are available in the Command Type 2 IOCB */ |
| 182 | avail_dsds = 3; |
| 183 | cur_dsd = (uint32_t *)&cmd_pkt->dseg_0_address; |
| 184 | |
| 185 | /* Load data segments */ |
FUJITA Tomonori | 385d70b | 2007-05-26 01:55:38 +0900 | [diff] [blame] | 186 | scsi_for_each_sg(cmd, sg, tot_dsds, i) { |
| 187 | cont_entry_t *cont_pkt; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 188 | |
FUJITA Tomonori | 385d70b | 2007-05-26 01:55:38 +0900 | [diff] [blame] | 189 | /* Allocate additional continuation packets? */ |
| 190 | if (avail_dsds == 0) { |
| 191 | /* |
| 192 | * Seven DSDs are available in the Continuation |
| 193 | * Type 0 IOCB. |
| 194 | */ |
Anirban Chakraborty | 73208df | 2008-12-09 16:45:39 -0800 | [diff] [blame] | 195 | cont_pkt = qla2x00_prep_cont_type0_iocb(req, vha); |
FUJITA Tomonori | 385d70b | 2007-05-26 01:55:38 +0900 | [diff] [blame] | 196 | cur_dsd = (uint32_t *)&cont_pkt->dseg_0_address; |
| 197 | avail_dsds = 7; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 198 | } |
FUJITA Tomonori | 385d70b | 2007-05-26 01:55:38 +0900 | [diff] [blame] | 199 | |
| 200 | *cur_dsd++ = cpu_to_le32(sg_dma_address(sg)); |
| 201 | *cur_dsd++ = cpu_to_le32(sg_dma_len(sg)); |
| 202 | avail_dsds--; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 203 | } |
| 204 | } |
| 205 | |
| 206 | /** |
| 207 | * qla2x00_build_scsi_iocbs_64() - Build IOCB command utilizing 64bit |
| 208 | * capable IOCB types. |
| 209 | * |
| 210 | * @sp: SRB command to process |
| 211 | * @cmd_pkt: Command type 3 IOCB |
| 212 | * @tot_dsds: Total number of segments to transfer |
| 213 | */ |
| 214 | void qla2x00_build_scsi_iocbs_64(srb_t *sp, cmd_entry_t *cmd_pkt, |
| 215 | uint16_t tot_dsds) |
| 216 | { |
| 217 | uint16_t avail_dsds; |
| 218 | uint32_t *cur_dsd; |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 219 | scsi_qla_host_t *vha; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 220 | struct scsi_cmnd *cmd; |
FUJITA Tomonori | 385d70b | 2007-05-26 01:55:38 +0900 | [diff] [blame] | 221 | struct scatterlist *sg; |
| 222 | int i; |
Anirban Chakraborty | 73208df | 2008-12-09 16:45:39 -0800 | [diff] [blame] | 223 | struct req_que *req; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 224 | |
| 225 | cmd = sp->cmd; |
| 226 | |
| 227 | /* Update entry type to indicate Command Type 3 IOCB */ |
| 228 | *((uint32_t *)(&cmd_pkt->entry_type)) = |
| 229 | __constant_cpu_to_le32(COMMAND_A64_TYPE); |
| 230 | |
| 231 | /* No data transfer */ |
FUJITA Tomonori | 385d70b | 2007-05-26 01:55:38 +0900 | [diff] [blame] | 232 | if (!scsi_bufflen(cmd) || cmd->sc_data_direction == DMA_NONE) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 233 | cmd_pkt->byte_count = __constant_cpu_to_le32(0); |
| 234 | return; |
| 235 | } |
| 236 | |
Andrew Vasquez | 444786d | 2009-01-05 11:18:10 -0800 | [diff] [blame] | 237 | vha = sp->fcport->vha; |
Anirban Chakraborty | 17d9863 | 2008-12-18 10:06:15 -0800 | [diff] [blame] | 238 | req = sp->que; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 239 | |
Harish Zunjarrao | 49fd462 | 2008-09-11 21:22:47 -0700 | [diff] [blame] | 240 | cmd_pkt->control_flags |= cpu_to_le16(qla2x00_get_cmd_direction(sp)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 241 | |
| 242 | /* Two DSDs are available in the Command Type 3 IOCB */ |
| 243 | avail_dsds = 2; |
| 244 | cur_dsd = (uint32_t *)&cmd_pkt->dseg_0_address; |
| 245 | |
| 246 | /* Load data segments */ |
FUJITA Tomonori | 385d70b | 2007-05-26 01:55:38 +0900 | [diff] [blame] | 247 | scsi_for_each_sg(cmd, sg, tot_dsds, i) { |
| 248 | dma_addr_t sle_dma; |
| 249 | cont_a64_entry_t *cont_pkt; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 250 | |
FUJITA Tomonori | 385d70b | 2007-05-26 01:55:38 +0900 | [diff] [blame] | 251 | /* Allocate additional continuation packets? */ |
| 252 | if (avail_dsds == 0) { |
| 253 | /* |
| 254 | * Five DSDs are available in the Continuation |
| 255 | * Type 1 IOCB. |
| 256 | */ |
Anirban Chakraborty | 73208df | 2008-12-09 16:45:39 -0800 | [diff] [blame] | 257 | cont_pkt = qla2x00_prep_cont_type1_iocb(req, vha); |
FUJITA Tomonori | 385d70b | 2007-05-26 01:55:38 +0900 | [diff] [blame] | 258 | cur_dsd = (uint32_t *)cont_pkt->dseg_0_address; |
| 259 | avail_dsds = 5; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 260 | } |
FUJITA Tomonori | 385d70b | 2007-05-26 01:55:38 +0900 | [diff] [blame] | 261 | |
| 262 | sle_dma = sg_dma_address(sg); |
| 263 | *cur_dsd++ = cpu_to_le32(LSD(sle_dma)); |
| 264 | *cur_dsd++ = cpu_to_le32(MSD(sle_dma)); |
| 265 | *cur_dsd++ = cpu_to_le32(sg_dma_len(sg)); |
| 266 | avail_dsds--; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 267 | } |
| 268 | } |
| 269 | |
| 270 | /** |
| 271 | * qla2x00_start_scsi() - Send a SCSI command to the ISP |
| 272 | * @sp: command to send to the ISP |
| 273 | * |
Bjorn Helgaas | cc3ef7b | 2008-09-11 21:22:51 -0700 | [diff] [blame] | 274 | * Returns non-zero if a failure occurred, else zero. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 275 | */ |
| 276 | int |
| 277 | qla2x00_start_scsi(srb_t *sp) |
| 278 | { |
FUJITA Tomonori | 385d70b | 2007-05-26 01:55:38 +0900 | [diff] [blame] | 279 | int ret, nseg; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 280 | unsigned long flags; |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 281 | scsi_qla_host_t *vha; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 282 | struct scsi_cmnd *cmd; |
| 283 | uint32_t *clr_ptr; |
| 284 | uint32_t index; |
| 285 | uint32_t handle; |
| 286 | cmd_entry_t *cmd_pkt; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 287 | uint16_t cnt; |
| 288 | uint16_t req_cnt; |
| 289 | uint16_t tot_dsds; |
Andrew Vasquez | 3d71644 | 2005-07-06 10:30:26 -0700 | [diff] [blame] | 290 | struct device_reg_2xxx __iomem *reg; |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 291 | struct qla_hw_data *ha; |
| 292 | struct req_que *req; |
Anirban Chakraborty | 73208df | 2008-12-09 16:45:39 -0800 | [diff] [blame] | 293 | struct rsp_que *rsp; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 294 | |
| 295 | /* Setup device pointers. */ |
| 296 | ret = 0; |
Andrew Vasquez | 444786d | 2009-01-05 11:18:10 -0800 | [diff] [blame] | 297 | vha = sp->fcport->vha; |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 298 | ha = vha->hw; |
Andrew Vasquez | 3d71644 | 2005-07-06 10:30:26 -0700 | [diff] [blame] | 299 | reg = &ha->iobase->isp; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 300 | cmd = sp->cmd; |
Anirban Chakraborty | 73208df | 2008-12-09 16:45:39 -0800 | [diff] [blame] | 301 | req = ha->req_q_map[0]; |
| 302 | rsp = ha->rsp_q_map[0]; |
| 8302192 | 2005-04-17 15:10:41 -0500 | [diff] [blame] | 303 | /* So we know we haven't pci_map'ed anything yet */ |
| 304 | tot_dsds = 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 305 | |
| 306 | /* Send marker if required */ |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 307 | if (vha->marker_needed != 0) { |
Anirban Chakraborty | 73208df | 2008-12-09 16:45:39 -0800 | [diff] [blame] | 308 | if (qla2x00_marker(vha, req, rsp, 0, 0, MK_SYNC_ALL) |
| 309 | != QLA_SUCCESS) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 310 | return (QLA_FUNCTION_FAILED); |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 311 | vha->marker_needed = 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 312 | } |
| 313 | |
| 314 | /* Acquire ring specific lock */ |
Andrew Vasquez | c9c5ced | 2008-07-24 08:31:49 -0700 | [diff] [blame] | 315 | spin_lock_irqsave(&ha->hardware_lock, flags); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 316 | |
| 317 | /* Check for room in outstanding command list. */ |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 318 | handle = req->current_outstanding_cmd; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 319 | for (index = 1; index < MAX_OUTSTANDING_COMMANDS; index++) { |
| 320 | handle++; |
| 321 | if (handle == MAX_OUTSTANDING_COMMANDS) |
| 322 | handle = 1; |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 323 | if (!req->outstanding_cmds[handle]) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 324 | break; |
| 325 | } |
| 326 | if (index == MAX_OUTSTANDING_COMMANDS) |
| 327 | goto queuing_error; |
| 328 | |
| 8302192 | 2005-04-17 15:10:41 -0500 | [diff] [blame] | 329 | /* Map the sg table so we have an accurate count of sg entries needed */ |
Seokmann Ju | 2c3dfe3 | 2007-07-05 13:16:51 -0700 | [diff] [blame] | 330 | if (scsi_sg_count(cmd)) { |
| 331 | nseg = dma_map_sg(&ha->pdev->dev, scsi_sglist(cmd), |
| 332 | scsi_sg_count(cmd), cmd->sc_data_direction); |
| 333 | if (unlikely(!nseg)) |
| 334 | goto queuing_error; |
| 335 | } else |
| 336 | nseg = 0; |
| 337 | |
FUJITA Tomonori | 385d70b | 2007-05-26 01:55:38 +0900 | [diff] [blame] | 338 | tot_dsds = nseg; |
| 8302192 | 2005-04-17 15:10:41 -0500 | [diff] [blame] | 339 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 340 | /* Calculate the number of request entries needed. */ |
Andrew Vasquez | fd34f55 | 2007-07-19 15:06:00 -0700 | [diff] [blame] | 341 | req_cnt = ha->isp_ops->calc_req_entries(tot_dsds); |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 342 | if (req->cnt < (req_cnt + 2)) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 343 | cnt = RD_REG_WORD_RELAXED(ISP_REQ_Q_OUT(ha, reg)); |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 344 | if (req->ring_index < cnt) |
| 345 | req->cnt = cnt - req->ring_index; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 346 | else |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 347 | req->cnt = req->length - |
| 348 | (req->ring_index - cnt); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 349 | } |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 350 | if (req->cnt < (req_cnt + 2)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 351 | goto queuing_error; |
| 352 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 353 | /* Build command packet */ |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 354 | req->current_outstanding_cmd = handle; |
| 355 | req->outstanding_cmds[handle] = sp; |
Anirban Chakraborty | 17d9863 | 2008-12-18 10:06:15 -0800 | [diff] [blame] | 356 | sp->que = req; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 357 | sp->cmd->host_scribble = (unsigned char *)(unsigned long)handle; |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 358 | req->cnt -= req_cnt; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 359 | |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 360 | cmd_pkt = (cmd_entry_t *)req->ring_ptr; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 361 | cmd_pkt->handle = handle; |
| 362 | /* Zero out remaining portion of packet. */ |
| 363 | clr_ptr = (uint32_t *)cmd_pkt + 2; |
| 364 | memset(clr_ptr, 0, REQUEST_ENTRY_SIZE - 8); |
| 365 | cmd_pkt->dseg_count = cpu_to_le16(tot_dsds); |
| 366 | |
| bdf7962 | 2005-04-17 15:06:53 -0500 | [diff] [blame] | 367 | /* Set target ID and LUN number*/ |
| 368 | SET_TARGET_ID(ha, cmd_pkt->target, sp->fcport->loop_id); |
| 369 | cmd_pkt->lun = cpu_to_le16(sp->cmd->device->lun); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 370 | |
| 371 | /* Update tagged queuing modifier */ |
| 372 | cmd_pkt->control_flags = __constant_cpu_to_le16(CF_SIMPLE_TAG); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 373 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 374 | /* Load SCSI command packet. */ |
| 375 | memcpy(cmd_pkt->scsi_cdb, cmd->cmnd, cmd->cmd_len); |
FUJITA Tomonori | 385d70b | 2007-05-26 01:55:38 +0900 | [diff] [blame] | 376 | cmd_pkt->byte_count = cpu_to_le32((uint32_t)scsi_bufflen(cmd)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 377 | |
| 378 | /* Build IOCB segments */ |
Andrew Vasquez | fd34f55 | 2007-07-19 15:06:00 -0700 | [diff] [blame] | 379 | ha->isp_ops->build_iocbs(sp, cmd_pkt, tot_dsds); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 380 | |
| 381 | /* Set total data segment count. */ |
| 382 | cmd_pkt->entry_count = (uint8_t)req_cnt; |
| 383 | wmb(); |
| 384 | |
| 385 | /* Adjust ring index. */ |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 386 | req->ring_index++; |
| 387 | if (req->ring_index == req->length) { |
| 388 | req->ring_index = 0; |
| 389 | req->ring_ptr = req->ring; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 390 | } else |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 391 | req->ring_ptr++; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 392 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 393 | sp->flags |= SRB_DMA_VALID; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 394 | |
| 395 | /* Set chip new ring index. */ |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 396 | WRT_REG_WORD(ISP_REQ_Q_IN(ha, reg), req->ring_index); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 397 | RD_REG_WORD_RELAXED(ISP_REQ_Q_IN(ha, reg)); /* PCI Posting. */ |
| 398 | |
Andrew Vasquez | 4fdfefe | 2005-10-27 11:09:48 -0700 | [diff] [blame] | 399 | /* Manage unprocessed RIO/ZIO commands in response queue. */ |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 400 | if (vha->flags.process_response_queue && |
Anirban Chakraborty | 73208df | 2008-12-09 16:45:39 -0800 | [diff] [blame] | 401 | rsp->ring_ptr->signature != RESPONSE_PROCESSED) |
| 402 | qla2x00_process_response_queue(rsp); |
Andrew Vasquez | 4fdfefe | 2005-10-27 11:09:48 -0700 | [diff] [blame] | 403 | |
Andrew Vasquez | c9c5ced | 2008-07-24 08:31:49 -0700 | [diff] [blame] | 404 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 405 | return (QLA_SUCCESS); |
| 406 | |
| 407 | queuing_error: |
FUJITA Tomonori | 385d70b | 2007-05-26 01:55:38 +0900 | [diff] [blame] | 408 | if (tot_dsds) |
| 409 | scsi_dma_unmap(cmd); |
| 410 | |
Andrew Vasquez | c9c5ced | 2008-07-24 08:31:49 -0700 | [diff] [blame] | 411 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 412 | |
| 413 | return (QLA_FUNCTION_FAILED); |
| 414 | } |
| 415 | |
| 416 | /** |
| 417 | * qla2x00_marker() - Send a marker IOCB to the firmware. |
| 418 | * @ha: HA context |
| 419 | * @loop_id: loop ID |
| 420 | * @lun: LUN |
| 421 | * @type: marker modifier |
| 422 | * |
| 423 | * Can be called from both normal and interrupt context. |
| 424 | * |
Bjorn Helgaas | cc3ef7b | 2008-09-11 21:22:51 -0700 | [diff] [blame] | 425 | * Returns non-zero if a failure occurred, else zero. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 426 | */ |
Andrew Vasquez | fa2a1ce | 2005-07-06 10:32:07 -0700 | [diff] [blame] | 427 | int |
Anirban Chakraborty | 73208df | 2008-12-09 16:45:39 -0800 | [diff] [blame] | 428 | __qla2x00_marker(struct scsi_qla_host *vha, struct req_que *req, |
| 429 | struct rsp_que *rsp, uint16_t loop_id, |
| 430 | uint16_t lun, uint8_t type) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 431 | { |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 432 | mrk_entry_t *mrk; |
| 433 | struct mrk_entry_24xx *mrk24; |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 434 | struct qla_hw_data *ha = vha->hw; |
| 435 | scsi_qla_host_t *base_vha = pci_get_drvdata(ha->pdev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 436 | |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 437 | mrk24 = NULL; |
Anirban Chakraborty | 73208df | 2008-12-09 16:45:39 -0800 | [diff] [blame] | 438 | mrk = (mrk_entry_t *)qla2x00_req_pkt(vha, req, rsp); |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 439 | if (mrk == NULL) { |
| 440 | DEBUG2_3(printk("%s(%ld): failed to allocate Marker IOCB.\n", |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 441 | __func__, base_vha->host_no)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 442 | |
| 443 | return (QLA_FUNCTION_FAILED); |
| 444 | } |
| 445 | |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 446 | mrk->entry_type = MARKER_TYPE; |
| 447 | mrk->modifier = type; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 448 | if (type != MK_SYNC_ALL) { |
Andrew Vasquez | e428924 | 2007-07-19 15:05:56 -0700 | [diff] [blame] | 449 | if (IS_FWI2_CAPABLE(ha)) { |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 450 | mrk24 = (struct mrk_entry_24xx *) mrk; |
| 451 | mrk24->nport_handle = cpu_to_le16(loop_id); |
| 452 | mrk24->lun[1] = LSB(lun); |
| 453 | mrk24->lun[2] = MSB(lun); |
Shyam Sundar | b797b6d | 2006-08-01 13:48:13 -0700 | [diff] [blame] | 454 | host_to_fcp_swap(mrk24->lun, sizeof(mrk24->lun)); |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 455 | mrk24->vp_index = vha->vp_idx; |
Anirban Chakraborty | 2afa19a | 2009-04-06 22:33:40 -0700 | [diff] [blame^] | 456 | mrk24->handle = MAKE_HANDLE(req->id, mrk24->handle); |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 457 | } else { |
| 458 | SET_TARGET_ID(ha, mrk->target, loop_id); |
| 459 | mrk->lun = cpu_to_le16(lun); |
| 460 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 461 | } |
| 462 | wmb(); |
| 463 | |
Anirban Chakraborty | 73208df | 2008-12-09 16:45:39 -0800 | [diff] [blame] | 464 | qla2x00_isp_cmd(vha, req); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 465 | |
| 466 | return (QLA_SUCCESS); |
| 467 | } |
| 468 | |
Andrew Vasquez | fa2a1ce | 2005-07-06 10:32:07 -0700 | [diff] [blame] | 469 | int |
Anirban Chakraborty | 73208df | 2008-12-09 16:45:39 -0800 | [diff] [blame] | 470 | qla2x00_marker(struct scsi_qla_host *vha, struct req_que *req, |
| 471 | struct rsp_que *rsp, uint16_t loop_id, uint16_t lun, |
| 472 | uint8_t type) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 473 | { |
| 474 | int ret; |
| 475 | unsigned long flags = 0; |
| 476 | |
Anirban Chakraborty | 73208df | 2008-12-09 16:45:39 -0800 | [diff] [blame] | 477 | spin_lock_irqsave(&vha->hw->hardware_lock, flags); |
| 478 | ret = __qla2x00_marker(vha, req, rsp, loop_id, lun, type); |
| 479 | spin_unlock_irqrestore(&vha->hw->hardware_lock, flags); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 480 | |
| 481 | return (ret); |
| 482 | } |
| 483 | |
| 484 | /** |
| 485 | * qla2x00_req_pkt() - Retrieve a request packet from the request ring. |
| 486 | * @ha: HA context |
| 487 | * |
| 488 | * Note: The caller must hold the hardware lock before calling this routine. |
| 489 | * |
| 490 | * Returns NULL if function failed, else, a pointer to the request packet. |
| 491 | */ |
| 492 | static request_t * |
Anirban Chakraborty | 73208df | 2008-12-09 16:45:39 -0800 | [diff] [blame] | 493 | qla2x00_req_pkt(struct scsi_qla_host *vha, struct req_que *req, |
| 494 | struct rsp_que *rsp) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 495 | { |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 496 | struct qla_hw_data *ha = vha->hw; |
Anirban Chakraborty | 73208df | 2008-12-09 16:45:39 -0800 | [diff] [blame] | 497 | device_reg_t __iomem *reg = ISP_QUE_REG(ha, req->id); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 498 | request_t *pkt = NULL; |
| 499 | uint16_t cnt; |
| 500 | uint32_t *dword_ptr; |
| 501 | uint32_t timer; |
| 502 | uint16_t req_cnt = 1; |
| 503 | |
| 504 | /* Wait 1 second for slot. */ |
| 505 | for (timer = HZ; timer; timer--) { |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 506 | if ((req_cnt + 2) >= req->cnt) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 507 | /* Calculate number of free request entries. */ |
Anirban Chakraborty | 73208df | 2008-12-09 16:45:39 -0800 | [diff] [blame] | 508 | if (ha->mqenable) |
| 509 | cnt = (uint16_t) |
| 510 | RD_REG_DWORD(®->isp25mq.req_q_out); |
| 511 | else { |
| 512 | if (IS_FWI2_CAPABLE(ha)) |
| 513 | cnt = (uint16_t)RD_REG_DWORD( |
| 514 | ®->isp24.req_q_out); |
| 515 | else |
| 516 | cnt = qla2x00_debounce_register( |
| 517 | ISP_REQ_Q_OUT(ha, ®->isp)); |
| 518 | } |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 519 | if (req->ring_index < cnt) |
| 520 | req->cnt = cnt - req->ring_index; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 521 | else |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 522 | req->cnt = req->length - |
| 523 | (req->ring_index - cnt); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 524 | } |
| 525 | /* If room for request in request ring. */ |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 526 | if ((req_cnt + 2) < req->cnt) { |
| 527 | req->cnt--; |
| 528 | pkt = req->ring_ptr; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 529 | |
| 530 | /* Zero out packet. */ |
| 531 | dword_ptr = (uint32_t *)pkt; |
| 532 | for (cnt = 0; cnt < REQUEST_ENTRY_SIZE / 4; cnt++) |
| 533 | *dword_ptr++ = 0; |
| 534 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 535 | /* Set entry count. */ |
| 536 | pkt->entry_count = 1; |
| 537 | |
| 538 | break; |
| 539 | } |
| 540 | |
| 541 | /* Release ring specific lock */ |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 542 | spin_unlock_irq(&ha->hardware_lock); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 543 | |
| 544 | udelay(2); /* 2 us */ |
| 545 | |
| 546 | /* Check for pending interrupts. */ |
| 547 | /* During init we issue marker directly */ |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 548 | if (!vha->marker_needed && !vha->flags.init_done) |
Anirban Chakraborty | 73208df | 2008-12-09 16:45:39 -0800 | [diff] [blame] | 549 | qla2x00_poll(rsp); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 550 | spin_lock_irq(&ha->hardware_lock); |
| 551 | } |
| 552 | if (!pkt) { |
| 553 | DEBUG2_3(printk("%s(): **** FAILED ****\n", __func__)); |
| 554 | } |
| 555 | |
| 556 | return (pkt); |
| 557 | } |
| 558 | |
| 559 | /** |
| 560 | * qla2x00_isp_cmd() - Modify the request ring pointer. |
| 561 | * @ha: HA context |
| 562 | * |
| 563 | * Note: The caller must hold the hardware lock before calling this routine. |
| 564 | */ |
Adrian Bunk | 413975a | 2006-06-30 02:33:06 -0700 | [diff] [blame] | 565 | static void |
Anirban Chakraborty | 73208df | 2008-12-09 16:45:39 -0800 | [diff] [blame] | 566 | qla2x00_isp_cmd(struct scsi_qla_host *vha, struct req_que *req) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 567 | { |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 568 | struct qla_hw_data *ha = vha->hw; |
Anirban Chakraborty | 73208df | 2008-12-09 16:45:39 -0800 | [diff] [blame] | 569 | device_reg_t __iomem *reg = ISP_QUE_REG(ha, req->id); |
Anirban Chakraborty | 17d9863 | 2008-12-18 10:06:15 -0800 | [diff] [blame] | 570 | struct device_reg_2xxx __iomem *ioreg = &ha->iobase->isp; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 571 | |
| 572 | DEBUG5(printk("%s(): IOCB data:\n", __func__)); |
| 573 | DEBUG5(qla2x00_dump_buffer( |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 574 | (uint8_t *)req->ring_ptr, REQUEST_ENTRY_SIZE)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 575 | |
| 576 | /* Adjust ring index. */ |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 577 | req->ring_index++; |
| 578 | if (req->ring_index == req->length) { |
| 579 | req->ring_index = 0; |
| 580 | req->ring_ptr = req->ring; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 581 | } else |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 582 | req->ring_ptr++; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 583 | |
| 584 | /* Set chip new ring index. */ |
Anirban Chakraborty | 17d9863 | 2008-12-18 10:06:15 -0800 | [diff] [blame] | 585 | if (ha->mqenable) { |
| 586 | WRT_REG_DWORD(®->isp25mq.req_q_in, req->ring_index); |
| 587 | RD_REG_DWORD(&ioreg->hccr); |
| 588 | } |
Anirban Chakraborty | 73208df | 2008-12-09 16:45:39 -0800 | [diff] [blame] | 589 | else { |
| 590 | if (IS_FWI2_CAPABLE(ha)) { |
| 591 | WRT_REG_DWORD(®->isp24.req_q_in, req->ring_index); |
| 592 | RD_REG_DWORD_RELAXED(®->isp24.req_q_in); |
| 593 | } else { |
| 594 | WRT_REG_WORD(ISP_REQ_Q_IN(ha, ®->isp), |
| 595 | req->ring_index); |
| 596 | RD_REG_WORD_RELAXED(ISP_REQ_Q_IN(ha, ®->isp)); |
| 597 | } |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 598 | } |
| 599 | |
| 600 | } |
| 601 | |
| 602 | /** |
| 603 | * qla24xx_calc_iocbs() - Determine number of Command Type 3 and |
| 604 | * Continuation Type 1 IOCBs to allocate. |
| 605 | * |
| 606 | * @dsds: number of data segment decriptors needed |
| 607 | * |
| 608 | * Returns the number of IOCB entries needed to store @dsds. |
| 609 | */ |
| 610 | static inline uint16_t |
| 611 | qla24xx_calc_iocbs(uint16_t dsds) |
| 612 | { |
| 613 | uint16_t iocbs; |
| 614 | |
| 615 | iocbs = 1; |
| 616 | if (dsds > 1) { |
| 617 | iocbs += (dsds - 1) / 5; |
| 618 | if ((dsds - 1) % 5) |
| 619 | iocbs++; |
| 620 | } |
| 621 | return iocbs; |
| 622 | } |
| 623 | |
| 624 | /** |
| 625 | * qla24xx_build_scsi_iocbs() - Build IOCB command utilizing Command Type 7 |
| 626 | * IOCB types. |
| 627 | * |
| 628 | * @sp: SRB command to process |
| 629 | * @cmd_pkt: Command type 3 IOCB |
| 630 | * @tot_dsds: Total number of segments to transfer |
| 631 | */ |
| 632 | static inline void |
| 633 | qla24xx_build_scsi_iocbs(srb_t *sp, struct cmd_type_7 *cmd_pkt, |
| 634 | uint16_t tot_dsds) |
| 635 | { |
| 636 | uint16_t avail_dsds; |
| 637 | uint32_t *cur_dsd; |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 638 | scsi_qla_host_t *vha; |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 639 | struct scsi_cmnd *cmd; |
FUJITA Tomonori | 385d70b | 2007-05-26 01:55:38 +0900 | [diff] [blame] | 640 | struct scatterlist *sg; |
| 641 | int i; |
Anirban Chakraborty | 73208df | 2008-12-09 16:45:39 -0800 | [diff] [blame] | 642 | struct req_que *req; |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 643 | |
| 644 | cmd = sp->cmd; |
| 645 | |
| 646 | /* Update entry type to indicate Command Type 3 IOCB */ |
| 647 | *((uint32_t *)(&cmd_pkt->entry_type)) = |
| 648 | __constant_cpu_to_le32(COMMAND_TYPE_7); |
| 649 | |
| 650 | /* No data transfer */ |
FUJITA Tomonori | 385d70b | 2007-05-26 01:55:38 +0900 | [diff] [blame] | 651 | if (!scsi_bufflen(cmd) || cmd->sc_data_direction == DMA_NONE) { |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 652 | cmd_pkt->byte_count = __constant_cpu_to_le32(0); |
| 653 | return; |
| 654 | } |
| 655 | |
Andrew Vasquez | 444786d | 2009-01-05 11:18:10 -0800 | [diff] [blame] | 656 | vha = sp->fcport->vha; |
Anirban Chakraborty | 17d9863 | 2008-12-18 10:06:15 -0800 | [diff] [blame] | 657 | req = sp->que; |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 658 | |
| 659 | /* Set transfer direction */ |
Harish Zunjarrao | 49fd462 | 2008-09-11 21:22:47 -0700 | [diff] [blame] | 660 | if (cmd->sc_data_direction == DMA_TO_DEVICE) { |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 661 | cmd_pkt->task_mgmt_flags = |
| 662 | __constant_cpu_to_le16(TMF_WRITE_DATA); |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 663 | sp->fcport->vha->hw->qla_stats.output_bytes += |
Harish Zunjarrao | 49fd462 | 2008-09-11 21:22:47 -0700 | [diff] [blame] | 664 | scsi_bufflen(sp->cmd); |
| 665 | } else if (cmd->sc_data_direction == DMA_FROM_DEVICE) { |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 666 | cmd_pkt->task_mgmt_flags = |
| 667 | __constant_cpu_to_le16(TMF_READ_DATA); |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 668 | sp->fcport->vha->hw->qla_stats.input_bytes += |
Harish Zunjarrao | 49fd462 | 2008-09-11 21:22:47 -0700 | [diff] [blame] | 669 | scsi_bufflen(sp->cmd); |
| 670 | } |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 671 | |
| 672 | /* One DSD is available in the Command Type 3 IOCB */ |
| 673 | avail_dsds = 1; |
| 674 | cur_dsd = (uint32_t *)&cmd_pkt->dseg_0_address; |
| 675 | |
| 676 | /* Load data segments */ |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 677 | |
FUJITA Tomonori | 385d70b | 2007-05-26 01:55:38 +0900 | [diff] [blame] | 678 | scsi_for_each_sg(cmd, sg, tot_dsds, i) { |
| 679 | dma_addr_t sle_dma; |
| 680 | cont_a64_entry_t *cont_pkt; |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 681 | |
FUJITA Tomonori | 385d70b | 2007-05-26 01:55:38 +0900 | [diff] [blame] | 682 | /* Allocate additional continuation packets? */ |
| 683 | if (avail_dsds == 0) { |
| 684 | /* |
| 685 | * Five DSDs are available in the Continuation |
| 686 | * Type 1 IOCB. |
| 687 | */ |
Anirban Chakraborty | 73208df | 2008-12-09 16:45:39 -0800 | [diff] [blame] | 688 | cont_pkt = qla2x00_prep_cont_type1_iocb(req, vha); |
FUJITA Tomonori | 385d70b | 2007-05-26 01:55:38 +0900 | [diff] [blame] | 689 | cur_dsd = (uint32_t *)cont_pkt->dseg_0_address; |
| 690 | avail_dsds = 5; |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 691 | } |
FUJITA Tomonori | 385d70b | 2007-05-26 01:55:38 +0900 | [diff] [blame] | 692 | |
| 693 | sle_dma = sg_dma_address(sg); |
| 694 | *cur_dsd++ = cpu_to_le32(LSD(sle_dma)); |
| 695 | *cur_dsd++ = cpu_to_le32(MSD(sle_dma)); |
| 696 | *cur_dsd++ = cpu_to_le32(sg_dma_len(sg)); |
| 697 | avail_dsds--; |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 698 | } |
| 699 | } |
| 700 | |
| 701 | |
| 702 | /** |
| 703 | * qla24xx_start_scsi() - Send a SCSI command to the ISP |
| 704 | * @sp: command to send to the ISP |
| 705 | * |
Bjorn Helgaas | cc3ef7b | 2008-09-11 21:22:51 -0700 | [diff] [blame] | 706 | * Returns non-zero if a failure occurred, else zero. |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 707 | */ |
| 708 | int |
| 709 | qla24xx_start_scsi(srb_t *sp) |
| 710 | { |
FUJITA Tomonori | 385d70b | 2007-05-26 01:55:38 +0900 | [diff] [blame] | 711 | int ret, nseg; |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 712 | unsigned long flags; |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 713 | uint32_t *clr_ptr; |
| 714 | uint32_t index; |
| 715 | uint32_t handle; |
| 716 | struct cmd_type_7 *cmd_pkt; |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 717 | uint16_t cnt; |
| 718 | uint16_t req_cnt; |
| 719 | uint16_t tot_dsds; |
Anirban Chakraborty | 73208df | 2008-12-09 16:45:39 -0800 | [diff] [blame] | 720 | struct req_que *req = NULL; |
| 721 | struct rsp_que *rsp = NULL; |
| 722 | struct scsi_cmnd *cmd = sp->cmd; |
Andrew Vasquez | 444786d | 2009-01-05 11:18:10 -0800 | [diff] [blame] | 723 | struct scsi_qla_host *vha = sp->fcport->vha; |
Anirban Chakraborty | 73208df | 2008-12-09 16:45:39 -0800 | [diff] [blame] | 724 | struct qla_hw_data *ha = vha->hw; |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 725 | |
| 726 | /* Setup device pointers. */ |
| 727 | ret = 0; |
Anirban Chakraborty | 73208df | 2008-12-09 16:45:39 -0800 | [diff] [blame] | 728 | |
Anirban Chakraborty | 2afa19a | 2009-04-06 22:33:40 -0700 | [diff] [blame^] | 729 | req = vha->req; |
| 730 | rsp = ha->rsp_q_map[0]; |
Anirban Chakraborty | 17d9863 | 2008-12-18 10:06:15 -0800 | [diff] [blame] | 731 | sp->que = req; |
Anirban Chakraborty | 73208df | 2008-12-09 16:45:39 -0800 | [diff] [blame] | 732 | |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 733 | /* So we know we haven't pci_map'ed anything yet */ |
| 734 | tot_dsds = 0; |
| 735 | |
| 736 | /* Send marker if required */ |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 737 | if (vha->marker_needed != 0) { |
Anirban Chakraborty | 73208df | 2008-12-09 16:45:39 -0800 | [diff] [blame] | 738 | if (qla2x00_marker(vha, req, rsp, 0, 0, MK_SYNC_ALL) |
| 739 | != QLA_SUCCESS) |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 740 | return QLA_FUNCTION_FAILED; |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 741 | vha->marker_needed = 0; |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 742 | } |
| 743 | |
| 744 | /* Acquire ring specific lock */ |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 745 | spin_lock_irqsave(&ha->hardware_lock, flags); |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 746 | |
| 747 | /* Check for room in outstanding command list. */ |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 748 | handle = req->current_outstanding_cmd; |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 749 | for (index = 1; index < MAX_OUTSTANDING_COMMANDS; index++) { |
| 750 | handle++; |
| 751 | if (handle == MAX_OUTSTANDING_COMMANDS) |
| 752 | handle = 1; |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 753 | if (!req->outstanding_cmds[handle]) |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 754 | break; |
| 755 | } |
| 756 | if (index == MAX_OUTSTANDING_COMMANDS) |
| 757 | goto queuing_error; |
| 758 | |
| 759 | /* Map the sg table so we have an accurate count of sg entries needed */ |
Seokmann Ju | 2c3dfe3 | 2007-07-05 13:16:51 -0700 | [diff] [blame] | 760 | if (scsi_sg_count(cmd)) { |
| 761 | nseg = dma_map_sg(&ha->pdev->dev, scsi_sglist(cmd), |
| 762 | scsi_sg_count(cmd), cmd->sc_data_direction); |
| 763 | if (unlikely(!nseg)) |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 764 | goto queuing_error; |
Seokmann Ju | 2c3dfe3 | 2007-07-05 13:16:51 -0700 | [diff] [blame] | 765 | } else |
| 766 | nseg = 0; |
| 767 | |
FUJITA Tomonori | 385d70b | 2007-05-26 01:55:38 +0900 | [diff] [blame] | 768 | tot_dsds = nseg; |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 769 | |
| 770 | req_cnt = qla24xx_calc_iocbs(tot_dsds); |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 771 | if (req->cnt < (req_cnt + 2)) { |
Andrew Vasquez | 0802999 | 2009-03-24 09:07:55 -0700 | [diff] [blame] | 772 | cnt = RD_REG_DWORD_RELAXED(req->req_q_out); |
Anirban Chakraborty | 73208df | 2008-12-09 16:45:39 -0800 | [diff] [blame] | 773 | |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 774 | if (req->ring_index < cnt) |
| 775 | req->cnt = cnt - req->ring_index; |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 776 | else |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 777 | req->cnt = req->length - |
| 778 | (req->ring_index - cnt); |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 779 | } |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 780 | if (req->cnt < (req_cnt + 2)) |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 781 | goto queuing_error; |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 782 | |
| 783 | /* Build command packet. */ |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 784 | req->current_outstanding_cmd = handle; |
| 785 | req->outstanding_cmds[handle] = sp; |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 786 | sp->cmd->host_scribble = (unsigned char *)(unsigned long)handle; |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 787 | req->cnt -= req_cnt; |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 788 | |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 789 | cmd_pkt = (struct cmd_type_7 *)req->ring_ptr; |
Anirban Chakraborty | 2afa19a | 2009-04-06 22:33:40 -0700 | [diff] [blame^] | 790 | cmd_pkt->handle = MAKE_HANDLE(req->id, handle); |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 791 | |
| 792 | /* Zero out remaining portion of packet. */ |
James Bottomley | 72df832 | 2005-10-28 14:41:19 -0500 | [diff] [blame] | 793 | /* tagged queuing modifier -- default is TSK_SIMPLE (0). */ |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 794 | clr_ptr = (uint32_t *)cmd_pkt + 2; |
| 795 | memset(clr_ptr, 0, REQUEST_ENTRY_SIZE - 8); |
| 796 | cmd_pkt->dseg_count = cpu_to_le16(tot_dsds); |
| 797 | |
| 798 | /* Set NPORT-ID and LUN number*/ |
| 799 | cmd_pkt->nport_handle = cpu_to_le16(sp->fcport->loop_id); |
| 800 | cmd_pkt->port_id[0] = sp->fcport->d_id.b.al_pa; |
| 801 | cmd_pkt->port_id[1] = sp->fcport->d_id.b.area; |
| 802 | cmd_pkt->port_id[2] = sp->fcport->d_id.b.domain; |
Seokmann Ju | 2c3dfe3 | 2007-07-05 13:16:51 -0700 | [diff] [blame] | 803 | cmd_pkt->vp_index = sp->fcport->vp_idx; |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 804 | |
Andrew Vasquez | 661c3f6 | 2005-10-27 11:09:58 -0700 | [diff] [blame] | 805 | int_to_scsilun(sp->cmd->device->lun, &cmd_pkt->lun); |
andrew.vasquez@qlogic.com | 0d4be12 | 2006-02-07 08:45:35 -0800 | [diff] [blame] | 806 | host_to_fcp_swap((uint8_t *)&cmd_pkt->lun, sizeof(cmd_pkt->lun)); |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 807 | |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 808 | /* Load SCSI command packet. */ |
| 809 | memcpy(cmd_pkt->fcp_cdb, cmd->cmnd, cmd->cmd_len); |
| 810 | host_to_fcp_swap(cmd_pkt->fcp_cdb, sizeof(cmd_pkt->fcp_cdb)); |
| 811 | |
FUJITA Tomonori | 385d70b | 2007-05-26 01:55:38 +0900 | [diff] [blame] | 812 | cmd_pkt->byte_count = cpu_to_le32((uint32_t)scsi_bufflen(cmd)); |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 813 | |
| 814 | /* Build IOCB segments */ |
| 815 | qla24xx_build_scsi_iocbs(sp, cmd_pkt, tot_dsds); |
| 816 | |
| 817 | /* Set total data segment count. */ |
| 818 | cmd_pkt->entry_count = (uint8_t)req_cnt; |
Anirban Chakraborty | 2afa19a | 2009-04-06 22:33:40 -0700 | [diff] [blame^] | 819 | /* Specify response queue number where completion should happen */ |
| 820 | cmd_pkt->entry_status = (uint8_t) rsp->id; |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 821 | wmb(); |
| 822 | |
| 823 | /* Adjust ring index. */ |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 824 | req->ring_index++; |
| 825 | if (req->ring_index == req->length) { |
| 826 | req->ring_index = 0; |
| 827 | req->ring_ptr = req->ring; |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 828 | } else |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 829 | req->ring_ptr++; |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 830 | |
| 831 | sp->flags |= SRB_DMA_VALID; |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 832 | |
| 833 | /* Set chip new ring index. */ |
Andrew Vasquez | 0802999 | 2009-03-24 09:07:55 -0700 | [diff] [blame] | 834 | WRT_REG_DWORD(req->req_q_in, req->ring_index); |
| 835 | RD_REG_DWORD_RELAXED(&ha->iobase->isp24.hccr); |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 836 | |
Andrew Vasquez | 4fdfefe | 2005-10-27 11:09:48 -0700 | [diff] [blame] | 837 | /* Manage unprocessed RIO/ZIO commands in response queue. */ |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 838 | if (vha->flags.process_response_queue && |
Anirban Chakraborty | 73208df | 2008-12-09 16:45:39 -0800 | [diff] [blame] | 839 | rsp->ring_ptr->signature != RESPONSE_PROCESSED) |
Anirban Chakraborty | 2afa19a | 2009-04-06 22:33:40 -0700 | [diff] [blame^] | 840 | qla24xx_process_response_queue(vha, rsp); |
Andrew Vasquez | 4fdfefe | 2005-10-27 11:09:48 -0700 | [diff] [blame] | 841 | |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 842 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 843 | return QLA_SUCCESS; |
| 844 | |
| 845 | queuing_error: |
FUJITA Tomonori | 385d70b | 2007-05-26 01:55:38 +0900 | [diff] [blame] | 846 | if (tot_dsds) |
| 847 | scsi_dma_unmap(cmd); |
| 848 | |
Anirban Chakraborty | e315cd2 | 2008-11-06 10:40:51 -0800 | [diff] [blame] | 849 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
Andrew Vasquez | 2b6c0ce | 2005-07-06 10:31:17 -0700 | [diff] [blame] | 850 | |
| 851 | return QLA_FUNCTION_FAILED; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 852 | } |