aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorNaresh Kumar Inna <naresh@chelsio.com>2012-11-20 07:45:40 -0500
committerJames Bottomley <JBottomley@Parallels.com>2012-11-30 10:32:10 -0500
commit5036f0a0ecd31fc94360a944b352d082e1182b04 (patch)
tree98d5b957f1cd88b70b4965cf7dc16dc7862d0e42 /drivers
parent68d91cbd5267e15a7c6da1415a1c65a9506aed96 (diff)
[SCSI] csiostor: Fix sparse warnings.
This patch fixes sparse warnings related to endian-ness, which were reported by the 0-day kernel build and testing tool. Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Naresh Kumar Inna <naresh@chelsio.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/csiostor/csio_attr.c34
-rw-r--r--drivers/scsi/csiostor/csio_hw.c14
-rw-r--r--drivers/scsi/csiostor/csio_hw.h6
-rw-r--r--drivers/scsi/csiostor/csio_lnode.c91
-rw-r--r--drivers/scsi/csiostor/csio_mb.c62
-rw-r--r--drivers/scsi/csiostor/csio_rnode.c11
-rw-r--r--drivers/scsi/csiostor/csio_scsi.c8
-rw-r--r--drivers/scsi/csiostor/t4fw_api_stor.h12
8 files changed, 110 insertions, 128 deletions
diff --git a/drivers/scsi/csiostor/csio_attr.c b/drivers/scsi/csiostor/csio_attr.c
index c8cf85785db2..065a87ace623 100644
--- a/drivers/scsi/csiostor/csio_attr.c
+++ b/drivers/scsi/csiostor/csio_attr.c
@@ -89,7 +89,7 @@ csio_reg_rnode(struct csio_rnode *rn)
89 spin_unlock_irq(shost->host_lock); 89 spin_unlock_irq(shost->host_lock);
90 90
91 sp = &rn->rn_sparm; 91 sp = &rn->rn_sparm;
92 rport->maxframe_size = sp->csp.sp_bb_data; 92 rport->maxframe_size = ntohs(sp->csp.sp_bb_data);
93 if (ntohs(sp->clsp[2].cp_class) & FC_CPC_VALID) 93 if (ntohs(sp->clsp[2].cp_class) & FC_CPC_VALID)
94 rport->supported_classes = FC_COS_CLASS3; 94 rport->supported_classes = FC_COS_CLASS3;
95 else 95 else
@@ -192,7 +192,7 @@ csio_fchost_attr_init(struct csio_lnode *ln)
192 fc_host_supported_speeds(shost) = FC_PORTSPEED_10GBIT | 192 fc_host_supported_speeds(shost) = FC_PORTSPEED_10GBIT |
193 FC_PORTSPEED_1GBIT; 193 FC_PORTSPEED_1GBIT;
194 194
195 fc_host_maxframe_size(shost) = ln->ln_sparm.csp.sp_bb_data; 195 fc_host_maxframe_size(shost) = ntohs(ln->ln_sparm.csp.sp_bb_data);
196 memset(fc_host_supported_fc4s(shost), 0, 196 memset(fc_host_supported_fc4s(shost), 0,
197 sizeof(fc_host_supported_fc4s(shost))); 197 sizeof(fc_host_supported_fc4s(shost)));
198 fc_host_supported_fc4s(shost)[7] = 1; 198 fc_host_supported_fc4s(shost)[7] = 1;
@@ -325,23 +325,23 @@ csio_get_stats(struct Scsi_Host *shost)
325 memset(&fcoe_port_stats, 0, sizeof(struct fw_fcoe_port_stats)); 325 memset(&fcoe_port_stats, 0, sizeof(struct fw_fcoe_port_stats));
326 csio_get_phy_port_stats(hw, ln->portid, &fcoe_port_stats); 326 csio_get_phy_port_stats(hw, ln->portid, &fcoe_port_stats);
327 327
328 fhs->tx_frames += (fcoe_port_stats.tx_bcast_frames + 328 fhs->tx_frames += (be64_to_cpu(fcoe_port_stats.tx_bcast_frames) +
329 fcoe_port_stats.tx_mcast_frames + 329 be64_to_cpu(fcoe_port_stats.tx_mcast_frames) +
330 fcoe_port_stats.tx_ucast_frames + 330 be64_to_cpu(fcoe_port_stats.tx_ucast_frames) +
331 fcoe_port_stats.tx_offload_frames); 331 be64_to_cpu(fcoe_port_stats.tx_offload_frames));
332 fhs->tx_words += (fcoe_port_stats.tx_bcast_bytes + 332 fhs->tx_words += (be64_to_cpu(fcoe_port_stats.tx_bcast_bytes) +
333 fcoe_port_stats.tx_mcast_bytes + 333 be64_to_cpu(fcoe_port_stats.tx_mcast_bytes) +
334 fcoe_port_stats.tx_ucast_bytes + 334 be64_to_cpu(fcoe_port_stats.tx_ucast_bytes) +
335 fcoe_port_stats.tx_offload_bytes) / 335 be64_to_cpu(fcoe_port_stats.tx_offload_bytes)) /
336 CSIO_WORD_TO_BYTE; 336 CSIO_WORD_TO_BYTE;
337 fhs->rx_frames += (fcoe_port_stats.rx_bcast_frames + 337 fhs->rx_frames += (be64_to_cpu(fcoe_port_stats.rx_bcast_frames) +
338 fcoe_port_stats.rx_mcast_frames + 338 be64_to_cpu(fcoe_port_stats.rx_mcast_frames) +
339 fcoe_port_stats.rx_ucast_frames); 339 be64_to_cpu(fcoe_port_stats.rx_ucast_frames));
340 fhs->rx_words += (fcoe_port_stats.rx_bcast_bytes + 340 fhs->rx_words += (be64_to_cpu(fcoe_port_stats.rx_bcast_bytes) +
341 fcoe_port_stats.rx_mcast_bytes + 341 be64_to_cpu(fcoe_port_stats.rx_mcast_bytes) +
342 fcoe_port_stats.rx_ucast_bytes) / 342 be64_to_cpu(fcoe_port_stats.rx_ucast_bytes)) /
343 CSIO_WORD_TO_BYTE; 343 CSIO_WORD_TO_BYTE;
344 fhs->error_frames += fcoe_port_stats.rx_err_frames; 344 fhs->error_frames += be64_to_cpu(fcoe_port_stats.rx_err_frames);
345 fhs->fcp_input_requests += ln->stats.n_input_requests; 345 fhs->fcp_input_requests += ln->stats.n_input_requests;
346 fhs->fcp_output_requests += ln->stats.n_output_requests; 346 fhs->fcp_output_requests += ln->stats.n_output_requests;
347 fhs->fcp_control_requests += ln->stats.n_control_requests; 347 fhs->fcp_control_requests += ln->stats.n_control_requests;
diff --git a/drivers/scsi/csiostor/csio_hw.c b/drivers/scsi/csiostor/csio_hw.c
index 963c6c1d68b7..8ecdb94a59f4 100644
--- a/drivers/scsi/csiostor/csio_hw.c
+++ b/drivers/scsi/csiostor/csio_hw.c
@@ -169,7 +169,7 @@ csio_set_reg_field(struct csio_hw *hw, uint32_t reg, uint32_t mask,
169 * is assigned the 64-bit ECC word for the read data. 169 * is assigned the 64-bit ECC word for the read data.
170 */ 170 */
171int 171int
172csio_hw_mc_read(struct csio_hw *hw, uint32_t addr, uint32_t *data, 172csio_hw_mc_read(struct csio_hw *hw, uint32_t addr, __be32 *data,
173 uint64_t *ecc) 173 uint64_t *ecc)
174{ 174{
175 int i; 175 int i;
@@ -209,7 +209,7 @@ csio_hw_mc_read(struct csio_hw *hw, uint32_t addr, uint32_t *data,
209 * is assigned the 64-bit ECC word for the read data. 209 * is assigned the 64-bit ECC word for the read data.
210 */ 210 */
211int 211int
212csio_hw_edc_read(struct csio_hw *hw, int idx, uint32_t addr, uint32_t *data, 212csio_hw_edc_read(struct csio_hw *hw, int idx, uint32_t addr, __be32 *data,
213 uint64_t *ecc) 213 uint64_t *ecc)
214{ 214{
215 int i; 215 int i;
@@ -249,7 +249,7 @@ csio_hw_edc_read(struct csio_hw *hw, int idx, uint32_t addr, uint32_t *data,
249 * address @addr. 249 * address @addr.
250 */ 250 */
251static int 251static int
252csio_mem_win_rw(struct csio_hw *hw, u32 addr, __be32 *data, int dir) 252csio_mem_win_rw(struct csio_hw *hw, u32 addr, u32 *data, int dir)
253{ 253{
254 int i; 254 int i;
255 255
@@ -296,7 +296,7 @@ csio_memory_rw(struct csio_hw *hw, int mtype, u32 addr, u32 len,
296{ 296{
297 uint32_t pos, start, end, offset, memoffset; 297 uint32_t pos, start, end, offset, memoffset;
298 int ret; 298 int ret;
299 __be32 *data; 299 uint32_t *data;
300 300
301 /* 301 /*
302 * Argument sanity checks ... 302 * Argument sanity checks ...
@@ -379,7 +379,7 @@ csio_memory_rw(struct csio_hw *hw, int mtype, u32 addr, u32 len,
379} 379}
380 380
381static int 381static int
382csio_memory_write(struct csio_hw *hw, int mtype, u32 addr, u32 len, __be32 *buf) 382csio_memory_write(struct csio_hw *hw, int mtype, u32 addr, u32 len, u32 *buf)
383{ 383{
384 return csio_memory_rw(hw, mtype, addr, len, buf, 0); 384 return csio_memory_rw(hw, mtype, addr, len, buf, 0);
385} 385}
@@ -429,6 +429,7 @@ csio_hw_seeprom_read(struct csio_hw *hw, uint32_t addr, uint32_t *data)
429 429
430 pci_read_config_dword(hw->pdev, base + PCI_VPD_DATA, data); 430 pci_read_config_dword(hw->pdev, base + PCI_VPD_DATA, data);
431 *data = le32_to_cpu(*data); 431 *data = le32_to_cpu(*data);
432
432 return 0; 433 return 0;
433} 434}
434 435
@@ -926,7 +927,7 @@ csio_hw_fw_dload(struct csio_hw *hw, uint8_t *fw_data, uint32_t size)
926 int ret; 927 int ret;
927 uint32_t i; 928 uint32_t i;
928 uint8_t first_page[SF_PAGE_SIZE]; 929 uint8_t first_page[SF_PAGE_SIZE];
929 const uint32_t *p = (const uint32_t *)fw_data; 930 const __be32 *p = (const __be32 *)fw_data;
930 struct fw_hdr *hdr = (struct fw_hdr *)fw_data; 931 struct fw_hdr *hdr = (struct fw_hdr *)fw_data;
931 uint32_t sf_sec_size; 932 uint32_t sf_sec_size;
932 933
@@ -2116,7 +2117,6 @@ csio_hw_flash_config(struct csio_hw *hw, u32 *fw_cfg_param, char *path)
2116 const struct firmware *cf; 2117 const struct firmware *cf;
2117 struct pci_dev *pci_dev = hw->pdev; 2118 struct pci_dev *pci_dev = hw->pdev;
2118 struct device *dev = &pci_dev->dev; 2119 struct device *dev = &pci_dev->dev;
2119
2120 unsigned int mtype = 0, maddr = 0; 2120 unsigned int mtype = 0, maddr = 0;
2121 uint32_t *cfg_data; 2121 uint32_t *cfg_data;
2122 int value_to_add = 0; 2122 int value_to_add = 0;
diff --git a/drivers/scsi/csiostor/csio_hw.h b/drivers/scsi/csiostor/csio_hw.h
index 2a9b052a58e4..9edcca4c71af 100644
--- a/drivers/scsi/csiostor/csio_hw.h
+++ b/drivers/scsi/csiostor/csio_hw.h
@@ -658,10 +658,8 @@ void csio_intr_disable(struct csio_hw *, bool);
658struct csio_lnode *csio_lnode_alloc(struct csio_hw *); 658struct csio_lnode *csio_lnode_alloc(struct csio_hw *);
659int csio_config_queues(struct csio_hw *); 659int csio_config_queues(struct csio_hw *);
660 660
661int csio_hw_mc_read(struct csio_hw *, uint32_t, 661int csio_hw_mc_read(struct csio_hw *, uint32_t, __be32 *, uint64_t *);
662 uint32_t *, uint64_t *); 662int csio_hw_edc_read(struct csio_hw *, int, uint32_t, __be32 *, uint64_t *);
663int csio_hw_edc_read(struct csio_hw *, int, uint32_t, uint32_t *,
664 uint64_t *);
665int csio_hw_init(struct csio_hw *); 663int csio_hw_init(struct csio_hw *);
666void csio_hw_exit(struct csio_hw *); 664void csio_hw_exit(struct csio_hw *);
667#endif /* ifndef __CSIO_HW_H__ */ 665#endif /* ifndef __CSIO_HW_H__ */
diff --git a/drivers/scsi/csiostor/csio_lnode.c b/drivers/scsi/csiostor/csio_lnode.c
index 551959e7324a..5322c81cc702 100644
--- a/drivers/scsi/csiostor/csio_lnode.c
+++ b/drivers/scsi/csiostor/csio_lnode.c
@@ -214,7 +214,7 @@ csio_fill_ct_iu(void *buf, uint8_t type, uint8_t sub_type, uint16_t op)
214 cmd->ct_rev = FC_CT_REV; 214 cmd->ct_rev = FC_CT_REV;
215 cmd->ct_fs_type = type; 215 cmd->ct_fs_type = type;
216 cmd->ct_fs_subtype = sub_type; 216 cmd->ct_fs_subtype = sub_type;
217 cmd->ct_cmd = op; 217 cmd->ct_cmd = htons(op);
218} 218}
219 219
220static int 220static int
@@ -285,11 +285,13 @@ csio_ln_fdmi_rhba_cbfn(struct csio_hw *hw, struct csio_ioreq *fdmi_req)
285 void *cmd; 285 void *cmd;
286 uint8_t *pld; 286 uint8_t *pld;
287 uint32_t len = 0; 287 uint32_t len = 0;
288 __be32 val;
289 __be16 mfs;
290 uint32_t numattrs = 0;
288 struct csio_lnode *ln = fdmi_req->lnode; 291 struct csio_lnode *ln = fdmi_req->lnode;
289 struct fs_fdmi_attrs *attrib_blk; 292 struct fs_fdmi_attrs *attrib_blk;
290 struct fc_fdmi_port_name *port_name; 293 struct fc_fdmi_port_name *port_name;
291 uint8_t buf[64]; 294 uint8_t buf[64];
292 uint32_t val;
293 uint8_t *fc4_type; 295 uint8_t *fc4_type;
294 296
295 if (fdmi_req->wr_status != FW_SUCCESS) { 297 if (fdmi_req->wr_status != FW_SUCCESS) {
@@ -311,7 +313,7 @@ csio_ln_fdmi_rhba_cbfn(struct csio_hw *hw, struct csio_ioreq *fdmi_req)
311 313
312 /* Prepare CT hdr for RPA cmd */ 314 /* Prepare CT hdr for RPA cmd */
313 memset(cmd, 0, FC_CT_HDR_LEN); 315 memset(cmd, 0, FC_CT_HDR_LEN);
314 csio_fill_ct_iu(cmd, FC_FST_MGMT, FC_FDMI_SUBTYPE, htons(FC_FDMI_RPA)); 316 csio_fill_ct_iu(cmd, FC_FST_MGMT, FC_FDMI_SUBTYPE, FC_FDMI_RPA);
315 317
316 /* Prepare RPA payload */ 318 /* Prepare RPA payload */
317 pld = (uint8_t *)csio_ct_get_pld(cmd); 319 pld = (uint8_t *)csio_ct_get_pld(cmd);
@@ -331,12 +333,12 @@ csio_ln_fdmi_rhba_cbfn(struct csio_hw *hw, struct csio_ioreq *fdmi_req)
331 fc4_type[7] = 1; 333 fc4_type[7] = 1;
332 csio_append_attrib(&pld, FC_FDMI_PORT_ATTR_FC4TYPES, 334 csio_append_attrib(&pld, FC_FDMI_PORT_ATTR_FC4TYPES,
333 fc4_type, FC_FDMI_PORT_ATTR_FC4TYPES_LEN); 335 fc4_type, FC_FDMI_PORT_ATTR_FC4TYPES_LEN);
334 attrib_blk->numattrs++; 336 numattrs++;
335 val = htonl(FC_PORTSPEED_1GBIT | FC_PORTSPEED_10GBIT); 337 val = htonl(FC_PORTSPEED_1GBIT | FC_PORTSPEED_10GBIT);
336 csio_append_attrib(&pld, FC_FDMI_PORT_ATTR_SUPPORTEDSPEED, 338 csio_append_attrib(&pld, FC_FDMI_PORT_ATTR_SUPPORTEDSPEED,
337 (uint8_t *)&val, 339 (uint8_t *)&val,
338 FC_FDMI_PORT_ATTR_SUPPORTEDSPEED_LEN); 340 FC_FDMI_PORT_ATTR_SUPPORTEDSPEED_LEN);
339 attrib_blk->numattrs++; 341 numattrs++;
340 342
341 if (hw->pport[ln->portid].link_speed == FW_PORT_CAP_SPEED_1G) 343 if (hw->pport[ln->portid].link_speed == FW_PORT_CAP_SPEED_1G)
342 val = htonl(FC_PORTSPEED_1GBIT); 344 val = htonl(FC_PORTSPEED_1GBIT);
@@ -347,24 +349,24 @@ csio_ln_fdmi_rhba_cbfn(struct csio_hw *hw, struct csio_ioreq *fdmi_req)
347 csio_append_attrib(&pld, FC_FDMI_PORT_ATTR_CURRENTPORTSPEED, 349 csio_append_attrib(&pld, FC_FDMI_PORT_ATTR_CURRENTPORTSPEED,
348 (uint8_t *)&val, 350 (uint8_t *)&val,
349 FC_FDMI_PORT_ATTR_CURRENTPORTSPEED_LEN); 351 FC_FDMI_PORT_ATTR_CURRENTPORTSPEED_LEN);
350 attrib_blk->numattrs++; 352 numattrs++;
351 353
352 val = htonl(ln->ln_sparm.csp.sp_bb_data); 354 mfs = ln->ln_sparm.csp.sp_bb_data;
353 csio_append_attrib(&pld, FC_FDMI_PORT_ATTR_MAXFRAMESIZE, 355 csio_append_attrib(&pld, FC_FDMI_PORT_ATTR_MAXFRAMESIZE,
354 (uint8_t *)&val, FC_FDMI_PORT_ATTR_MAXFRAMESIZE_LEN); 356 (uint8_t *)&mfs, FC_FDMI_PORT_ATTR_MAXFRAMESIZE_LEN);
355 attrib_blk->numattrs++; 357 numattrs++;
356 358
357 strcpy(buf, "csiostor"); 359 strcpy(buf, "csiostor");
358 csio_append_attrib(&pld, FC_FDMI_PORT_ATTR_OSDEVICENAME, buf, 360 csio_append_attrib(&pld, FC_FDMI_PORT_ATTR_OSDEVICENAME, buf,
359 (uint16_t)strlen(buf)); 361 (uint16_t)strlen(buf));
360 attrib_blk->numattrs++; 362 numattrs++;
361 363
362 if (!csio_hostname(buf, sizeof(buf))) { 364 if (!csio_hostname(buf, sizeof(buf))) {
363 csio_append_attrib(&pld, FC_FDMI_PORT_ATTR_HOSTNAME, 365 csio_append_attrib(&pld, FC_FDMI_PORT_ATTR_HOSTNAME,
364 buf, (uint16_t)strlen(buf)); 366 buf, (uint16_t)strlen(buf));
365 attrib_blk->numattrs++; 367 numattrs++;
366 } 368 }
367 attrib_blk->numattrs = ntohl(attrib_blk->numattrs); 369 attrib_blk->numattrs = htonl(numattrs);
368 len = (uint32_t)(pld - (uint8_t *)cmd); 370 len = (uint32_t)(pld - (uint8_t *)cmd);
369 371
370 /* Submit FDMI RPA request */ 372 /* Submit FDMI RPA request */
@@ -388,7 +390,8 @@ csio_ln_fdmi_dprt_cbfn(struct csio_hw *hw, struct csio_ioreq *fdmi_req)
388 void *cmd; 390 void *cmd;
389 uint8_t *pld; 391 uint8_t *pld;
390 uint32_t len = 0; 392 uint32_t len = 0;
391 uint32_t maxpayload = htonl(65536); 393 uint32_t numattrs = 0;
394 __be32 maxpayload = htonl(65536);
392 struct fc_fdmi_hba_identifier *hbaid; 395 struct fc_fdmi_hba_identifier *hbaid;
393 struct csio_lnode *ln = fdmi_req->lnode; 396 struct csio_lnode *ln = fdmi_req->lnode;
394 struct fc_fdmi_rpl *reg_pl; 397 struct fc_fdmi_rpl *reg_pl;
@@ -413,7 +416,7 @@ csio_ln_fdmi_dprt_cbfn(struct csio_hw *hw, struct csio_ioreq *fdmi_req)
413 416
414 /* Prepare CT hdr for RHBA cmd */ 417 /* Prepare CT hdr for RHBA cmd */
415 memset(cmd, 0, FC_CT_HDR_LEN); 418 memset(cmd, 0, FC_CT_HDR_LEN);
416 csio_fill_ct_iu(cmd, FC_FST_MGMT, FC_FDMI_SUBTYPE, htons(FC_FDMI_RHBA)); 419 csio_fill_ct_iu(cmd, FC_FST_MGMT, FC_FDMI_SUBTYPE, FC_FDMI_RHBA);
417 len = FC_CT_HDR_LEN; 420 len = FC_CT_HDR_LEN;
418 421
419 /* Prepare RHBA payload */ 422 /* Prepare RHBA payload */
@@ -424,7 +427,7 @@ csio_ln_fdmi_dprt_cbfn(struct csio_hw *hw, struct csio_ioreq *fdmi_req)
424 427
425 /* Register one port per hba */ 428 /* Register one port per hba */
426 reg_pl = (struct fc_fdmi_rpl *)pld; 429 reg_pl = (struct fc_fdmi_rpl *)pld;
427 reg_pl->numport = ntohl(1); 430 reg_pl->numport = htonl(1);
428 memcpy(&reg_pl->port[0].portname, csio_ln_wwpn(ln), 8); 431 memcpy(&reg_pl->port[0].portname, csio_ln_wwpn(ln), 8);
429 pld += sizeof(*reg_pl); 432 pld += sizeof(*reg_pl);
430 433
@@ -436,42 +439,42 @@ csio_ln_fdmi_dprt_cbfn(struct csio_hw *hw, struct csio_ioreq *fdmi_req)
436 439
437 csio_append_attrib(&pld, FC_FDMI_HBA_ATTR_NODENAME, csio_ln_wwnn(ln), 440 csio_append_attrib(&pld, FC_FDMI_HBA_ATTR_NODENAME, csio_ln_wwnn(ln),
438 FC_FDMI_HBA_ATTR_NODENAME_LEN); 441 FC_FDMI_HBA_ATTR_NODENAME_LEN);
439 attrib_blk->numattrs++; 442 numattrs++;
440 443
441 memset(buf, 0, sizeof(buf)); 444 memset(buf, 0, sizeof(buf));
442 445
443 strcpy(buf, "Chelsio Communications"); 446 strcpy(buf, "Chelsio Communications");
444 csio_append_attrib(&pld, FC_FDMI_HBA_ATTR_MANUFACTURER, buf, 447 csio_append_attrib(&pld, FC_FDMI_HBA_ATTR_MANUFACTURER, buf,
445 (uint16_t)strlen(buf)); 448 (uint16_t)strlen(buf));
446 attrib_blk->numattrs++; 449 numattrs++;
447 csio_append_attrib(&pld, FC_FDMI_HBA_ATTR_SERIALNUMBER, 450 csio_append_attrib(&pld, FC_FDMI_HBA_ATTR_SERIALNUMBER,
448 hw->vpd.sn, (uint16_t)sizeof(hw->vpd.sn)); 451 hw->vpd.sn, (uint16_t)sizeof(hw->vpd.sn));
449 attrib_blk->numattrs++; 452 numattrs++;
450 csio_append_attrib(&pld, FC_FDMI_HBA_ATTR_MODEL, hw->vpd.id, 453 csio_append_attrib(&pld, FC_FDMI_HBA_ATTR_MODEL, hw->vpd.id,
451 (uint16_t)sizeof(hw->vpd.id)); 454 (uint16_t)sizeof(hw->vpd.id));
452 attrib_blk->numattrs++; 455 numattrs++;
453 csio_append_attrib(&pld, FC_FDMI_HBA_ATTR_MODELDESCRIPTION, 456 csio_append_attrib(&pld, FC_FDMI_HBA_ATTR_MODELDESCRIPTION,
454 hw->model_desc, (uint16_t)strlen(hw->model_desc)); 457 hw->model_desc, (uint16_t)strlen(hw->model_desc));
455 attrib_blk->numattrs++; 458 numattrs++;
456 csio_append_attrib(&pld, FC_FDMI_HBA_ATTR_HARDWAREVERSION, 459 csio_append_attrib(&pld, FC_FDMI_HBA_ATTR_HARDWAREVERSION,
457 hw->hw_ver, (uint16_t)sizeof(hw->hw_ver)); 460 hw->hw_ver, (uint16_t)sizeof(hw->hw_ver));
458 attrib_blk->numattrs++; 461 numattrs++;
459 csio_append_attrib(&pld, FC_FDMI_HBA_ATTR_FIRMWAREVERSION, 462 csio_append_attrib(&pld, FC_FDMI_HBA_ATTR_FIRMWAREVERSION,
460 hw->fwrev_str, (uint16_t)strlen(hw->fwrev_str)); 463 hw->fwrev_str, (uint16_t)strlen(hw->fwrev_str));
461 attrib_blk->numattrs++; 464 numattrs++;
462 465
463 if (!csio_osname(buf, sizeof(buf))) { 466 if (!csio_osname(buf, sizeof(buf))) {
464 csio_append_attrib(&pld, FC_FDMI_HBA_ATTR_OSNAMEVERSION, 467 csio_append_attrib(&pld, FC_FDMI_HBA_ATTR_OSNAMEVERSION,
465 buf, (uint16_t)strlen(buf)); 468 buf, (uint16_t)strlen(buf));
466 attrib_blk->numattrs++; 469 numattrs++;
467 } 470 }
468 471
469 csio_append_attrib(&pld, FC_FDMI_HBA_ATTR_MAXCTPAYLOAD, 472 csio_append_attrib(&pld, FC_FDMI_HBA_ATTR_MAXCTPAYLOAD,
470 (uint8_t *)&maxpayload, 473 (uint8_t *)&maxpayload,
471 FC_FDMI_HBA_ATTR_MAXCTPAYLOAD_LEN); 474 FC_FDMI_HBA_ATTR_MAXCTPAYLOAD_LEN);
472 len = (uint32_t)(pld - (uint8_t *)cmd); 475 len = (uint32_t)(pld - (uint8_t *)cmd);
473 attrib_blk->numattrs++; 476 numattrs++;
474 attrib_blk->numattrs = ntohl(attrib_blk->numattrs); 477 attrib_blk->numattrs = htonl(numattrs);
475 478
476 /* Submit FDMI RHBA request */ 479 /* Submit FDMI RHBA request */
477 spin_lock_irq(&hw->lock); 480 spin_lock_irq(&hw->lock);
@@ -518,7 +521,7 @@ csio_ln_fdmi_dhba_cbfn(struct csio_hw *hw, struct csio_ioreq *fdmi_req)
518 521
519 /* Prepare FDMI DPRT cmd */ 522 /* Prepare FDMI DPRT cmd */
520 memset(cmd, 0, FC_CT_HDR_LEN); 523 memset(cmd, 0, FC_CT_HDR_LEN);
521 csio_fill_ct_iu(cmd, FC_FST_MGMT, FC_FDMI_SUBTYPE, htons(FC_FDMI_DPRT)); 524 csio_fill_ct_iu(cmd, FC_FST_MGMT, FC_FDMI_SUBTYPE, FC_FDMI_DPRT);
522 len = FC_CT_HDR_LEN; 525 len = FC_CT_HDR_LEN;
523 port_name = (struct fc_fdmi_port_name *)csio_ct_get_pld(cmd); 526 port_name = (struct fc_fdmi_port_name *)csio_ct_get_pld(cmd);
524 memcpy(&port_name->portname, csio_ln_wwpn(ln), 8); 527 memcpy(&port_name->portname, csio_ln_wwpn(ln), 8);
@@ -567,7 +570,7 @@ csio_ln_fdmi_start(struct csio_lnode *ln, void *context)
567 /* Prepare FDMI DHBA cmd */ 570 /* Prepare FDMI DHBA cmd */
568 cmd = fdmi_req->dma_buf.vaddr; 571 cmd = fdmi_req->dma_buf.vaddr;
569 memset(cmd, 0, FC_CT_HDR_LEN); 572 memset(cmd, 0, FC_CT_HDR_LEN);
570 csio_fill_ct_iu(cmd, FC_FST_MGMT, FC_FDMI_SUBTYPE, htons(FC_FDMI_DHBA)); 573 csio_fill_ct_iu(cmd, FC_FST_MGMT, FC_FDMI_SUBTYPE, FC_FDMI_DHBA);
571 len = FC_CT_HDR_LEN; 574 len = FC_CT_HDR_LEN;
572 575
573 hbaid = (struct fc_fdmi_hba_identifier *)csio_ct_get_pld(cmd); 576 hbaid = (struct fc_fdmi_hba_identifier *)csio_ct_get_pld(cmd);
@@ -599,6 +602,7 @@ csio_ln_vnp_read_cbfn(struct csio_hw *hw, struct csio_mb *mbp)
599 struct fc_els_csp *csp; 602 struct fc_els_csp *csp;
600 struct fc_els_cssp *clsp; 603 struct fc_els_cssp *clsp;
601 enum fw_retval retval; 604 enum fw_retval retval;
605 __be32 nport_id;
602 606
603 retval = FW_CMD_RETVAL_GET(ntohl(rsp->alloc_to_len16)); 607 retval = FW_CMD_RETVAL_GET(ntohl(rsp->alloc_to_len16));
604 if (retval != FW_SUCCESS) { 608 if (retval != FW_SUCCESS) {
@@ -610,10 +614,9 @@ csio_ln_vnp_read_cbfn(struct csio_hw *hw, struct csio_mb *mbp)
610 spin_lock_irq(&hw->lock); 614 spin_lock_irq(&hw->lock);
611 615
612 memcpy(ln->mac, rsp->vnport_mac, sizeof(ln->mac)); 616 memcpy(ln->mac, rsp->vnport_mac, sizeof(ln->mac));
613 memcpy(&ln->nport_id, &rsp->vnport_mac[3], 617 memcpy(&nport_id, &rsp->vnport_mac[3], sizeof(uint8_t)*3);
614 sizeof(uint8_t)*3); 618 ln->nport_id = ntohl(nport_id);
615 ln->nport_id = ntohl(ln->nport_id); 619 ln->nport_id = ln->nport_id >> 8;
616 ln->nport_id = ln->nport_id>>8;
617 620
618 /* Update WWNs */ 621 /* Update WWNs */
619 /* 622 /*
@@ -628,18 +631,18 @@ csio_ln_vnp_read_cbfn(struct csio_hw *hw, struct csio_mb *mbp)
628 csp = (struct fc_els_csp *)rsp->cmn_srv_parms; 631 csp = (struct fc_els_csp *)rsp->cmn_srv_parms;
629 ln->ln_sparm.csp.sp_hi_ver = csp->sp_hi_ver; 632 ln->ln_sparm.csp.sp_hi_ver = csp->sp_hi_ver;
630 ln->ln_sparm.csp.sp_lo_ver = csp->sp_lo_ver; 633 ln->ln_sparm.csp.sp_lo_ver = csp->sp_lo_ver;
631 ln->ln_sparm.csp.sp_bb_cred = ntohs(csp->sp_bb_cred); 634 ln->ln_sparm.csp.sp_bb_cred = csp->sp_bb_cred;
632 ln->ln_sparm.csp.sp_features = ntohs(csp->sp_features); 635 ln->ln_sparm.csp.sp_features = csp->sp_features;
633 ln->ln_sparm.csp.sp_bb_data = ntohs(csp->sp_bb_data); 636 ln->ln_sparm.csp.sp_bb_data = csp->sp_bb_data;
634 ln->ln_sparm.csp.sp_r_a_tov = ntohl(csp->sp_r_a_tov); 637 ln->ln_sparm.csp.sp_r_a_tov = csp->sp_r_a_tov;
635 ln->ln_sparm.csp.sp_e_d_tov = ntohl(csp->sp_e_d_tov); 638 ln->ln_sparm.csp.sp_e_d_tov = csp->sp_e_d_tov;
636 639
637 /* Copy word 0 & word 1 of class sparam */ 640 /* Copy word 0 & word 1 of class sparam */
638 clsp = (struct fc_els_cssp *)rsp->clsp_word_0_1; 641 clsp = (struct fc_els_cssp *)rsp->clsp_word_0_1;
639 ln->ln_sparm.clsp[2].cp_class = ntohs(clsp->cp_class); 642 ln->ln_sparm.clsp[2].cp_class = clsp->cp_class;
640 ln->ln_sparm.clsp[2].cp_init = ntohs(clsp->cp_init); 643 ln->ln_sparm.clsp[2].cp_init = clsp->cp_init;
641 ln->ln_sparm.clsp[2].cp_recip = ntohs(clsp->cp_recip); 644 ln->ln_sparm.clsp[2].cp_recip = clsp->cp_recip;
642 ln->ln_sparm.clsp[2].cp_rdfs = ntohs(clsp->cp_rdfs); 645 ln->ln_sparm.clsp[2].cp_rdfs = clsp->cp_rdfs;
643 646
644 spin_unlock_irq(&hw->lock); 647 spin_unlock_irq(&hw->lock);
645 648
@@ -1499,7 +1502,7 @@ csio_fcoe_fwevt_handler(struct csio_hw *hw, __u8 cpl_op, __be64 *cmd)
1499 /* HW un lock here */ 1502 /* HW un lock here */
1500 } else { 1503 } else {
1501 csio_warn(hw, "Unexpected FCOE LINK status:0x%x\n", 1504 csio_warn(hw, "Unexpected FCOE LINK status:0x%x\n",
1502 ntohl(lcmd->lstatus)); 1505 lcmd->lstatus);
1503 CSIO_INC_STATS(hw, n_cpl_unexp); 1506 CSIO_INC_STATS(hw, n_cpl_unexp);
1504 } 1507 }
1505 } else if (cpl_op == CPL_FW6_PLD) { 1508 } else if (cpl_op == CPL_FW6_PLD) {
@@ -1663,7 +1666,7 @@ csio_ln_prep_ecwr(struct csio_ioreq *io_req, uint32_t wr_len,
1663 uint32_t did, uint32_t flow_id, uint8_t *fw_wr) 1666 uint32_t did, uint32_t flow_id, uint8_t *fw_wr)
1664{ 1667{
1665 struct fw_fcoe_els_ct_wr *wr; 1668 struct fw_fcoe_els_ct_wr *wr;
1666 uint32_t port_id; 1669 __be32 port_id;
1667 1670
1668 wr = (struct fw_fcoe_els_ct_wr *)fw_wr; 1671 wr = (struct fw_fcoe_els_ct_wr *)fw_wr;
1669 wr->op_immdlen = cpu_to_be32(FW_WR_OP(FW_FCOE_ELS_CT_WR) | 1672 wr->op_immdlen = cpu_to_be32(FW_WR_OP(FW_FCOE_ELS_CT_WR) |
@@ -1676,8 +1679,8 @@ csio_ln_prep_ecwr(struct csio_ioreq *io_req, uint32_t wr_len,
1676 wr->ctl_pri = 0; 1679 wr->ctl_pri = 0;
1677 wr->cp_en_class = 0; 1680 wr->cp_en_class = 0;
1678 wr->cookie = io_req->fw_handle; 1681 wr->cookie = io_req->fw_handle;
1679 wr->iqid = (uint16_t)cpu_to_be16(csio_q_physiqid( 1682 wr->iqid = cpu_to_be16(csio_q_physiqid(
1680 io_req->lnode->hwp, io_req->iq_idx)); 1683 io_req->lnode->hwp, io_req->iq_idx));
1681 wr->fl_to_sp = FW_FCOE_ELS_CT_WR_SP(1); 1684 wr->fl_to_sp = FW_FCOE_ELS_CT_WR_SP(1);
1682 wr->tmo_val = (uint8_t) io_req->tmo; 1685 wr->tmo_val = (uint8_t) io_req->tmo;
1683 port_id = htonl(sid); 1686 port_id = htonl(sid);
diff --git a/drivers/scsi/csiostor/csio_mb.c b/drivers/scsi/csiostor/csio_mb.c
index 7aaf1027688c..5b27c48f6836 100644
--- a/drivers/scsi/csiostor/csio_mb.c
+++ b/drivers/scsi/csiostor/csio_mb.c
@@ -1119,13 +1119,11 @@ csio_fcoe_read_portparams_init_mb(struct csio_hw *hw, struct csio_mb *mbp,
1119} /* csio_fcoe_read_portparams_init_mb */ 1119} /* csio_fcoe_read_portparams_init_mb */
1120 1120
1121void 1121void
1122csio_mb_process_portparams_rsp( 1122csio_mb_process_portparams_rsp(struct csio_hw *hw,
1123 struct csio_hw *hw,
1124 struct csio_mb *mbp, 1123 struct csio_mb *mbp,
1125 enum fw_retval *retval, 1124 enum fw_retval *retval,
1126 struct fw_fcoe_port_cmd_params *portparams, 1125 struct fw_fcoe_port_cmd_params *portparams,
1127 struct fw_fcoe_port_stats *portstats 1126 struct fw_fcoe_port_stats *portstats)
1128 )
1129{ 1127{
1130 struct fw_fcoe_stats_cmd *rsp = (struct fw_fcoe_stats_cmd *)(mbp->mb); 1128 struct fw_fcoe_stats_cmd *rsp = (struct fw_fcoe_stats_cmd *)(mbp->mb);
1131 struct fw_fcoe_port_stats stats; 1129 struct fw_fcoe_port_stats stats;
@@ -1142,50 +1140,32 @@ csio_mb_process_portparams_rsp(
1142 memcpy(dst, src, (portparams->nstats * 8)); 1140 memcpy(dst, src, (portparams->nstats * 8));
1143 if (portparams->idx == 1) { 1141 if (portparams->idx == 1) {
1144 /* Get the first 6 flits from the Mailbox */ 1142 /* Get the first 6 flits from the Mailbox */
1145 portstats->tx_bcast_bytes = 1143 portstats->tx_bcast_bytes = stats.tx_bcast_bytes;
1146 be64_to_cpu(stats.tx_bcast_bytes); 1144 portstats->tx_bcast_frames = stats.tx_bcast_frames;
1147 portstats->tx_bcast_frames = 1145 portstats->tx_mcast_bytes = stats.tx_mcast_bytes;
1148 be64_to_cpu(stats.tx_bcast_frames); 1146 portstats->tx_mcast_frames = stats.tx_mcast_frames;
1149 portstats->tx_mcast_bytes = 1147 portstats->tx_ucast_bytes = stats.tx_ucast_bytes;
1150 be64_to_cpu(stats.tx_mcast_bytes); 1148 portstats->tx_ucast_frames = stats.tx_ucast_frames;
1151 portstats->tx_mcast_frames =
1152 be64_to_cpu(stats.tx_mcast_frames);
1153 portstats->tx_ucast_bytes =
1154 be64_to_cpu(stats.tx_ucast_bytes);
1155 portstats->tx_ucast_frames =
1156 be64_to_cpu(stats.tx_ucast_frames);
1157 } 1149 }
1158 if (portparams->idx == 7) { 1150 if (portparams->idx == 7) {
1159 /* Get the second 6 flits from the Mailbox */ 1151 /* Get the second 6 flits from the Mailbox */
1160 portstats->tx_drop_frames = 1152 portstats->tx_drop_frames = stats.tx_drop_frames;
1161 be64_to_cpu(stats.tx_drop_frames); 1153 portstats->tx_offload_bytes = stats.tx_offload_bytes;
1162 portstats->tx_offload_bytes = 1154 portstats->tx_offload_frames = stats.tx_offload_frames;
1163 be64_to_cpu(stats.tx_offload_bytes);
1164 portstats->tx_offload_frames =
1165 be64_to_cpu(stats.tx_offload_frames);
1166#if 0 1155#if 0
1167 portstats->rx_pf_bytes = 1156 portstats->rx_pf_bytes = stats.rx_pf_bytes;
1168 be64_to_cpu(stats.rx_pf_bytes); 1157 portstats->rx_pf_frames = stats.rx_pf_frames;
1169 portstats->rx_pf_frames =
1170 be64_to_cpu(stats.rx_pf_frames);
1171#endif 1158#endif
1172 portstats->rx_bcast_bytes = 1159 portstats->rx_bcast_bytes = stats.rx_bcast_bytes;
1173 be64_to_cpu(stats.rx_bcast_bytes); 1160 portstats->rx_bcast_frames = stats.rx_bcast_frames;
1174 portstats->rx_bcast_frames = 1161 portstats->rx_mcast_bytes = stats.rx_mcast_bytes;
1175 be64_to_cpu(stats.rx_bcast_frames);
1176 portstats->rx_mcast_bytes =
1177 be64_to_cpu(stats.rx_mcast_bytes);
1178 } 1162 }
1179 if (portparams->idx == 13) { 1163 if (portparams->idx == 13) {
1180 /* Get the last 4 flits from the Mailbox */ 1164 /* Get the last 4 flits from the Mailbox */
1181 portstats->rx_mcast_frames = 1165 portstats->rx_mcast_frames = stats.rx_mcast_frames;
1182 be64_to_cpu(stats.rx_mcast_frames); 1166 portstats->rx_ucast_bytes = stats.rx_ucast_bytes;
1183 portstats->rx_ucast_bytes = 1167 portstats->rx_ucast_frames = stats.rx_ucast_frames;
1184 be64_to_cpu(stats.rx_ucast_bytes); 1168 portstats->rx_err_frames = stats.rx_err_frames;
1185 portstats->rx_ucast_frames =
1186 be64_to_cpu(stats.rx_ucast_frames);
1187 portstats->rx_err_frames =
1188 be64_to_cpu(stats.rx_err_frames);
1189 } 1169 }
1190 } 1170 }
1191} 1171}
@@ -1414,7 +1394,7 @@ csio_mb_issue(struct csio_hw *hw, struct csio_mb *mbp)
1414 (hw, data_reg + i)); 1394 (hw, data_reg + i));
1415 csio_wr_reg32(hw, 0, ctl_reg); 1395 csio_wr_reg32(hw, 0, ctl_reg);
1416 1396
1417 if (FW_CMD_RETVAL_GET(*(mbp->mb))) 1397 if (csio_mb_fw_retval(mbp) != FW_SUCCESS)
1418 CSIO_INC_STATS(mbm, n_err); 1398 CSIO_INC_STATS(mbm, n_err);
1419 1399
1420 CSIO_INC_STATS(mbm, n_rsp); 1400 CSIO_INC_STATS(mbm, n_rsp);
diff --git a/drivers/scsi/csiostor/csio_rnode.c b/drivers/scsi/csiostor/csio_rnode.c
index b0ae430e436a..51c6a388de2b 100644
--- a/drivers/scsi/csiostor/csio_rnode.c
+++ b/drivers/scsi/csiostor/csio_rnode.c
@@ -303,9 +303,9 @@ csio_confirm_rnode(struct csio_lnode *ln, uint32_t rdev_flowid,
303 uint8_t rport_type; 303 uint8_t rport_type;
304 struct csio_rnode *rn, *match_rn; 304 struct csio_rnode *rn, *match_rn;
305 uint32_t vnp_flowid; 305 uint32_t vnp_flowid;
306 uint32_t *port_id; 306 __be32 *port_id;
307 307
308 port_id = (uint32_t *)&rdevp->r_id[0]; 308 port_id = (__be32 *)&rdevp->r_id[0];
309 rport_type = 309 rport_type =
310 FW_RDEV_WR_RPORT_TYPE_GET(rdevp->rd_xfer_rdy_to_rport_type); 310 FW_RDEV_WR_RPORT_TYPE_GET(rdevp->rd_xfer_rdy_to_rport_type);
311 311
@@ -439,9 +439,9 @@ csio_rn_verify_rparams(struct csio_lnode *ln, struct csio_rnode *rn,
439 uint8_t null[8]; 439 uint8_t null[8];
440 uint8_t rport_type; 440 uint8_t rport_type;
441 uint8_t fc_class; 441 uint8_t fc_class;
442 uint32_t *did; 442 __be32 *did;
443 443
444 did = (uint32_t *) &rdevp->r_id[0]; 444 did = (__be32 *) &rdevp->r_id[0];
445 rport_type = 445 rport_type =
446 FW_RDEV_WR_RPORT_TYPE_GET(rdevp->rd_xfer_rdy_to_rport_type); 446 FW_RDEV_WR_RPORT_TYPE_GET(rdevp->rd_xfer_rdy_to_rport_type);
447 switch (rport_type) { 447 switch (rport_type) {
@@ -529,9 +529,10 @@ csio_rn_verify_rparams(struct csio_lnode *ln, struct csio_rnode *rn,
529 rn->nport_id = (ntohl(*did) >> 8) & CSIO_DID_MASK; 529 rn->nport_id = (ntohl(*did) >> 8) & CSIO_DID_MASK;
530 memcpy(csio_rn_wwnn(rn), rdevp->wwnn, 8); 530 memcpy(csio_rn_wwnn(rn), rdevp->wwnn, 8);
531 memcpy(csio_rn_wwpn(rn), rdevp->wwpn, 8); 531 memcpy(csio_rn_wwpn(rn), rdevp->wwpn, 8);
532 rn->rn_sparm.csp.sp_bb_data = ntohs(rdevp->rcv_fr_sz); 532 rn->rn_sparm.csp.sp_bb_data = rdevp->rcv_fr_sz;
533 fc_class = FW_RDEV_WR_CLASS_GET(rdevp->vft_to_qos); 533 fc_class = FW_RDEV_WR_CLASS_GET(rdevp->vft_to_qos);
534 rn->rn_sparm.clsp[fc_class - 1].cp_class = htons(FC_CPC_VALID); 534 rn->rn_sparm.clsp[fc_class - 1].cp_class = htons(FC_CPC_VALID);
535
535 return 0; 536 return 0;
536} 537}
537 538
diff --git a/drivers/scsi/csiostor/csio_scsi.c b/drivers/scsi/csiostor/csio_scsi.c
index fdbd7daf01f2..ddd38e5eb0e7 100644
--- a/drivers/scsi/csiostor/csio_scsi.c
+++ b/drivers/scsi/csiostor/csio_scsi.c
@@ -237,7 +237,7 @@ csio_scsi_init_cmd_wr(struct csio_ioreq *req, void *addr, uint32_t size)
237 DIV_ROUND_UP(size, 16))); 237 DIV_ROUND_UP(size, 16)));
238 238
239 wr->cookie = (uintptr_t) req; 239 wr->cookie = (uintptr_t) req;
240 wr->iqid = (uint16_t)cpu_to_be16(csio_q_physiqid(hw, req->iq_idx)); 240 wr->iqid = cpu_to_be16(csio_q_physiqid(hw, req->iq_idx));
241 wr->tmo_val = (uint8_t) req->tmo; 241 wr->tmo_val = (uint8_t) req->tmo;
242 wr->r3 = 0; 242 wr->r3 = 0;
243 memset(&wr->r5, 0, 8); 243 memset(&wr->r5, 0, 8);
@@ -396,7 +396,7 @@ csio_scsi_init_read_wr(struct csio_ioreq *req, void *wrp, uint32_t size)
396 wr->flowid_len16 = cpu_to_be32(FW_WR_FLOWID(rn->flowid) | 396 wr->flowid_len16 = cpu_to_be32(FW_WR_FLOWID(rn->flowid) |
397 FW_WR_LEN16(DIV_ROUND_UP(size, 16))); 397 FW_WR_LEN16(DIV_ROUND_UP(size, 16)));
398 wr->cookie = (uintptr_t)req; 398 wr->cookie = (uintptr_t)req;
399 wr->iqid = (uint16_t)cpu_to_be16(csio_q_physiqid(hw, req->iq_idx)); 399 wr->iqid = cpu_to_be16(csio_q_physiqid(hw, req->iq_idx));
400 wr->tmo_val = (uint8_t)(req->tmo); 400 wr->tmo_val = (uint8_t)(req->tmo);
401 wr->use_xfer_cnt = 1; 401 wr->use_xfer_cnt = 1;
402 wr->xfer_cnt = cpu_to_be32(scsi_bufflen(scmnd)); 402 wr->xfer_cnt = cpu_to_be32(scsi_bufflen(scmnd));
@@ -449,7 +449,7 @@ csio_scsi_init_write_wr(struct csio_ioreq *req, void *wrp, uint32_t size)
449 wr->flowid_len16 = cpu_to_be32(FW_WR_FLOWID(rn->flowid) | 449 wr->flowid_len16 = cpu_to_be32(FW_WR_FLOWID(rn->flowid) |
450 FW_WR_LEN16(DIV_ROUND_UP(size, 16))); 450 FW_WR_LEN16(DIV_ROUND_UP(size, 16)));
451 wr->cookie = (uintptr_t)req; 451 wr->cookie = (uintptr_t)req;
452 wr->iqid = (uint16_t)cpu_to_be16(csio_q_physiqid(hw, req->iq_idx)); 452 wr->iqid = cpu_to_be16(csio_q_physiqid(hw, req->iq_idx));
453 wr->tmo_val = (uint8_t)(req->tmo); 453 wr->tmo_val = (uint8_t)(req->tmo);
454 wr->use_xfer_cnt = 1; 454 wr->use_xfer_cnt = 1;
455 wr->xfer_cnt = cpu_to_be32(scsi_bufflen(scmnd)); 455 wr->xfer_cnt = cpu_to_be32(scsi_bufflen(scmnd));
@@ -680,7 +680,7 @@ csio_scsi_init_abrt_cls_wr(struct csio_ioreq *req, void *addr, uint32_t size,
680 DIV_ROUND_UP(size, 16))); 680 DIV_ROUND_UP(size, 16)));
681 681
682 wr->cookie = (uintptr_t) req; 682 wr->cookie = (uintptr_t) req;
683 wr->iqid = (uint16_t)cpu_to_be16(csio_q_physiqid(hw, req->iq_idx)); 683 wr->iqid = cpu_to_be16(csio_q_physiqid(hw, req->iq_idx));
684 wr->tmo_val = (uint8_t) req->tmo; 684 wr->tmo_val = (uint8_t) req->tmo;
685 /* 0 for CHK_ALL_IO tells FW to look up t_cookie */ 685 /* 0 for CHK_ALL_IO tells FW to look up t_cookie */
686 wr->sub_opcode_to_chk_all_io = 686 wr->sub_opcode_to_chk_all_io =
diff --git a/drivers/scsi/csiostor/t4fw_api_stor.h b/drivers/scsi/csiostor/t4fw_api_stor.h
index b96903a24e63..1223e0d5fc07 100644
--- a/drivers/scsi/csiostor/t4fw_api_stor.h
+++ b/drivers/scsi/csiostor/t4fw_api_stor.h
@@ -221,7 +221,7 @@ struct fw_rdev_wr {
221struct fw_fcoe_els_ct_wr { 221struct fw_fcoe_els_ct_wr {
222 __be32 op_immdlen; 222 __be32 op_immdlen;
223 __be32 flowid_len16; 223 __be32 flowid_len16;
224 __be64 cookie; 224 u64 cookie;
225 __be16 iqid; 225 __be16 iqid;
226 u8 tmo_val; 226 u8 tmo_val;
227 u8 els_ct_type; 227 u8 els_ct_type;
@@ -246,7 +246,7 @@ struct fw_fcoe_els_ct_wr {
246struct fw_scsi_write_wr { 246struct fw_scsi_write_wr {
247 __be32 op_immdlen; 247 __be32 op_immdlen;
248 __be32 flowid_len16; 248 __be32 flowid_len16;
249 __be64 cookie; 249 u64 cookie;
250 __be16 iqid; 250 __be16 iqid;
251 u8 tmo_val; 251 u8 tmo_val;
252 u8 use_xfer_cnt; 252 u8 use_xfer_cnt;
@@ -272,7 +272,7 @@ struct fw_scsi_write_wr {
272struct fw_scsi_read_wr { 272struct fw_scsi_read_wr {
273 __be32 op_immdlen; 273 __be32 op_immdlen;
274 __be32 flowid_len16; 274 __be32 flowid_len16;
275 __be64 cookie; 275 u64 cookie;
276 __be16 iqid; 276 __be16 iqid;
277 u8 tmo_val; 277 u8 tmo_val;
278 u8 use_xfer_cnt; 278 u8 use_xfer_cnt;
@@ -298,7 +298,7 @@ struct fw_scsi_read_wr {
298struct fw_scsi_cmd_wr { 298struct fw_scsi_cmd_wr {
299 __be32 op_immdlen; 299 __be32 op_immdlen;
300 __be32 flowid_len16; 300 __be32 flowid_len16;
301 __be64 cookie; 301 u64 cookie;
302 __be16 iqid; 302 __be16 iqid;
303 u8 tmo_val; 303 u8 tmo_val;
304 u8 r3; 304 u8 r3;
@@ -326,12 +326,12 @@ struct fw_scsi_cmd_wr {
326struct fw_scsi_abrt_cls_wr { 326struct fw_scsi_abrt_cls_wr {
327 __be32 op_immdlen; 327 __be32 op_immdlen;
328 __be32 flowid_len16; 328 __be32 flowid_len16;
329 __be64 cookie; 329 u64 cookie;
330 __be16 iqid; 330 __be16 iqid;
331 u8 tmo_val; 331 u8 tmo_val;
332 u8 sub_opcode_to_chk_all_io; 332 u8 sub_opcode_to_chk_all_io;
333 u8 r3[4]; 333 u8 r3[4];
334 __be64 t_cookie; 334 u64 t_cookie;
335}; 335};
336 336
337#define FW_SCSI_ABRT_CLS_WR_SUB_OPCODE(x) ((x) << 2) 337#define FW_SCSI_ABRT_CLS_WR_SUB_OPCODE(x) ((x) << 2)