aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_fsf.c
diff options
context:
space:
mode:
authorSwen Schillig <swen@vnet.ibm.com>2008-10-01 06:42:18 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-10-03 13:11:53 -0400
commit7ba58c9cc16d296290fe645acb11db2b01276544 (patch)
tree7dabe15082a18e3b5e449c6dad37f7d20ba95e64 /drivers/s390/scsi/zfcp_fsf.c
parent5ab944f97e09a3d52951fe903eed9a7b88d810b2 (diff)
[SCSI] zfcp: remove all typedefs and replace them with standards
Remove typedefs from zfcp, use already existing types instead. Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/s390/scsi/zfcp_fsf.c')
-rw-r--r--drivers/s390/scsi/zfcp_fsf.c53
1 files changed, 38 insertions, 15 deletions
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index 23dd9088153f..02a570084d88 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -68,7 +68,7 @@ static void zfcp_fsf_access_denied_port(struct zfcp_fsf_req *req,
68 struct fsf_qtcb_header *header = &req->qtcb->header; 68 struct fsf_qtcb_header *header = &req->qtcb->header;
69 dev_warn(&req->adapter->ccw_device->dev, 69 dev_warn(&req->adapter->ccw_device->dev,
70 "Access denied to port 0x%016Lx\n", 70 "Access denied to port 0x%016Lx\n",
71 port->wwpn); 71 (unsigned long long)port->wwpn);
72 zfcp_act_eval_err(req->adapter, header->fsf_status_qual.halfword[0]); 72 zfcp_act_eval_err(req->adapter, header->fsf_status_qual.halfword[0]);
73 zfcp_act_eval_err(req->adapter, header->fsf_status_qual.halfword[1]); 73 zfcp_act_eval_err(req->adapter, header->fsf_status_qual.halfword[1]);
74 zfcp_erp_port_access_denied(port, 55, req); 74 zfcp_erp_port_access_denied(port, 55, req);
@@ -81,7 +81,8 @@ static void zfcp_fsf_access_denied_unit(struct zfcp_fsf_req *req,
81 struct fsf_qtcb_header *header = &req->qtcb->header; 81 struct fsf_qtcb_header *header = &req->qtcb->header;
82 dev_warn(&req->adapter->ccw_device->dev, 82 dev_warn(&req->adapter->ccw_device->dev,
83 "Access denied to unit 0x%016Lx on port 0x%016Lx\n", 83 "Access denied to unit 0x%016Lx on port 0x%016Lx\n",
84 unit->fcp_lun, unit->port->wwpn); 84 (unsigned long long)unit->fcp_lun,
85 (unsigned long long)unit->port->wwpn);
85 zfcp_act_eval_err(req->adapter, header->fsf_status_qual.halfword[0]); 86 zfcp_act_eval_err(req->adapter, header->fsf_status_qual.halfword[0]);
86 zfcp_act_eval_err(req->adapter, header->fsf_status_qual.halfword[1]); 87 zfcp_act_eval_err(req->adapter, header->fsf_status_qual.halfword[1]);
87 zfcp_erp_unit_access_denied(unit, 59, req); 88 zfcp_erp_unit_access_denied(unit, 59, req);
@@ -1390,7 +1391,8 @@ static void zfcp_fsf_open_port_handler(struct zfcp_fsf_req *req)
1390 case FSF_MAXIMUM_NUMBER_OF_PORTS_EXCEEDED: 1391 case FSF_MAXIMUM_NUMBER_OF_PORTS_EXCEEDED:
1391 dev_warn(&req->adapter->ccw_device->dev, 1392 dev_warn(&req->adapter->ccw_device->dev,
1392 "Not enough FCP adapter resources to open " 1393 "Not enough FCP adapter resources to open "
1393 "remote port 0x%016Lx\n", port->wwpn); 1394 "remote port 0x%016Lx\n",
1395 (unsigned long long)port->wwpn);
1394 zfcp_erp_port_failed(port, 31, req); 1396 zfcp_erp_port_failed(port, 31, req);
1395 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1397 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1396 break; 1398 break;
@@ -1403,7 +1405,7 @@ static void zfcp_fsf_open_port_handler(struct zfcp_fsf_req *req)
1403 case FSF_SQ_NO_RETRY_POSSIBLE: 1405 case FSF_SQ_NO_RETRY_POSSIBLE:
1404 dev_warn(&req->adapter->ccw_device->dev, 1406 dev_warn(&req->adapter->ccw_device->dev,
1405 "Remote port 0x%016Lx could not be opened\n", 1407 "Remote port 0x%016Lx could not be opened\n",
1406 port->wwpn); 1408 (unsigned long long)port->wwpn);
1407 zfcp_erp_port_failed(port, 32, req); 1409 zfcp_erp_port_failed(port, 32, req);
1408 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1410 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1409 break; 1411 break;
@@ -1824,8 +1826,8 @@ static void zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *req)
1824 dev_warn(&adapter->ccw_device->dev, 1826 dev_warn(&adapter->ccw_device->dev,
1825 "LUN 0x%Lx on port 0x%Lx is already in " 1827 "LUN 0x%Lx on port 0x%Lx is already in "
1826 "use by CSS%d, MIF Image ID %x\n", 1828 "use by CSS%d, MIF Image ID %x\n",
1827 unit->fcp_lun, 1829 (unsigned long long)unit->fcp_lun,
1828 unit->port->wwpn, 1830 (unsigned long long)unit->port->wwpn,
1829 queue_designator->cssid, 1831 queue_designator->cssid,
1830 queue_designator->hla); 1832 queue_designator->hla);
1831 else 1833 else
@@ -1840,7 +1842,8 @@ static void zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *req)
1840 dev_warn(&adapter->ccw_device->dev, 1842 dev_warn(&adapter->ccw_device->dev,
1841 "No handle is available for LUN " 1843 "No handle is available for LUN "
1842 "0x%016Lx on port 0x%016Lx\n", 1844 "0x%016Lx on port 0x%016Lx\n",
1843 unit->fcp_lun, unit->port->wwpn); 1845 (unsigned long long)unit->fcp_lun,
1846 (unsigned long long)unit->port->wwpn);
1844 zfcp_erp_unit_failed(unit, 34, req); 1847 zfcp_erp_unit_failed(unit, 34, req);
1845 /* fall through */ 1848 /* fall through */
1846 case FSF_INVALID_COMMAND_OPTION: 1849 case FSF_INVALID_COMMAND_OPTION:
@@ -1879,7 +1882,8 @@ static void zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *req)
1879 dev_info(&adapter->ccw_device->dev, 1882 dev_info(&adapter->ccw_device->dev,
1880 "SCSI device at LUN 0x%016Lx on port " 1883 "SCSI device at LUN 0x%016Lx on port "
1881 "0x%016Lx opened read-only\n", 1884 "0x%016Lx opened read-only\n",
1882 unit->fcp_lun, unit->port->wwpn); 1885 (unsigned long long)unit->fcp_lun,
1886 (unsigned long long)unit->port->wwpn);
1883 } 1887 }
1884 1888
1885 if (exclusive && !readwrite) { 1889 if (exclusive && !readwrite) {
@@ -1887,7 +1891,8 @@ static void zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *req)
1887 "Exclusive read-only access not " 1891 "Exclusive read-only access not "
1888 "supported (unit 0x%016Lx, " 1892 "supported (unit 0x%016Lx, "
1889 "port 0x%016Lx)\n", 1893 "port 0x%016Lx)\n",
1890 unit->fcp_lun, unit->port->wwpn); 1894 (unsigned long long)unit->fcp_lun,
1895 (unsigned long long)unit->port->wwpn);
1891 zfcp_erp_unit_failed(unit, 35, req); 1896 zfcp_erp_unit_failed(unit, 35, req);
1892 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1897 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1893 zfcp_erp_unit_shutdown(unit, 0, 80, req); 1898 zfcp_erp_unit_shutdown(unit, 0, 80, req);
@@ -1896,7 +1901,8 @@ static void zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *req)
1896 "Shared read-write access not " 1901 "Shared read-write access not "
1897 "supported (unit 0x%016Lx, port " 1902 "supported (unit 0x%016Lx, port "
1898 "0x%016Lx\n)", 1903 "0x%016Lx\n)",
1899 unit->fcp_lun, unit->port->wwpn); 1904 (unsigned long long)unit->fcp_lun,
1905 (unsigned long long)unit->port->wwpn);
1900 zfcp_erp_unit_failed(unit, 36, req); 1906 zfcp_erp_unit_failed(unit, 36, req);
1901 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1907 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1902 zfcp_erp_unit_shutdown(unit, 0, 81, req); 1908 zfcp_erp_unit_shutdown(unit, 0, 81, req);
@@ -2197,7 +2203,8 @@ static void zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *req)
2197 "Incorrect direction %d, unit 0x%016Lx on port " 2203 "Incorrect direction %d, unit 0x%016Lx on port "
2198 "0x%016Lx closed\n", 2204 "0x%016Lx closed\n",
2199 req->qtcb->bottom.io.data_direction, 2205 req->qtcb->bottom.io.data_direction,
2200 unit->fcp_lun, unit->port->wwpn); 2206 (unsigned long long)unit->fcp_lun,
2207 (unsigned long long)unit->port->wwpn);
2201 zfcp_erp_adapter_shutdown(unit->port->adapter, 0, 133, req); 2208 zfcp_erp_adapter_shutdown(unit->port->adapter, 0, 133, req);
2202 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 2209 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
2203 break; 2210 break;
@@ -2206,7 +2213,8 @@ static void zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *req)
2206 "Incorrect CDB length %d, unit 0x%016Lx on " 2213 "Incorrect CDB length %d, unit 0x%016Lx on "
2207 "port 0x%016Lx closed\n", 2214 "port 0x%016Lx closed\n",
2208 req->qtcb->bottom.io.fcp_cmnd_length, 2215 req->qtcb->bottom.io.fcp_cmnd_length,
2209 unit->fcp_lun, unit->port->wwpn); 2216 (unsigned long long)unit->fcp_lun,
2217 (unsigned long long)unit->port->wwpn);
2210 zfcp_erp_adapter_shutdown(unit->port->adapter, 0, 134, req); 2218 zfcp_erp_adapter_shutdown(unit->port->adapter, 0, 134, req);
2211 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 2219 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
2212 break; 2220 break;
@@ -2237,6 +2245,20 @@ skip_fsfstatus:
2237 } 2245 }
2238} 2246}
2239 2247
2248static void zfcp_set_fcp_dl(struct fcp_cmnd_iu *fcp_cmd, u32 fcp_dl)
2249{
2250 u32 *fcp_dl_ptr;
2251
2252 /*
2253 * fcp_dl_addr = start address of fcp_cmnd structure +
2254 * size of fixed part + size of dynamically sized add_dcp_cdb field
2255 * SEE FCP-2 documentation
2256 */
2257 fcp_dl_ptr = (u32 *) ((unsigned char *) &fcp_cmd[1] +
2258 (fcp_cmd->add_fcp_cdb_length << 2));
2259 *fcp_dl_ptr = fcp_dl;
2260}
2261
2240/** 2262/**
2241 * zfcp_fsf_send_fcp_command_task - initiate an FCP command (for a SCSI command) 2263 * zfcp_fsf_send_fcp_command_task - initiate an FCP command (for a SCSI command)
2242 * @adapter: adapter where scsi command is issued 2264 * @adapter: adapter where scsi command is issued
@@ -2322,7 +2344,7 @@ int zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *adapter,
2322 memcpy(fcp_cmnd_iu->fcp_cdb, scsi_cmnd->cmnd, scsi_cmnd->cmd_len); 2344 memcpy(fcp_cmnd_iu->fcp_cdb, scsi_cmnd->cmnd, scsi_cmnd->cmd_len);
2323 2345
2324 req->qtcb->bottom.io.fcp_cmnd_length = sizeof(struct fcp_cmnd_iu) + 2346 req->qtcb->bottom.io.fcp_cmnd_length = sizeof(struct fcp_cmnd_iu) +
2325 fcp_cmnd_iu->add_fcp_cdb_length + sizeof(fcp_dl_t); 2347 fcp_cmnd_iu->add_fcp_cdb_length + sizeof(u32);
2326 2348
2327 real_bytes = zfcp_qdio_sbals_from_sg(req, sbtype, 2349 real_bytes = zfcp_qdio_sbals_from_sg(req, sbtype,
2328 scsi_sglist(scsi_cmnd), 2350 scsi_sglist(scsi_cmnd),
@@ -2334,7 +2356,8 @@ int zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *adapter,
2334 dev_err(&adapter->ccw_device->dev, 2356 dev_err(&adapter->ccw_device->dev,
2335 "Oversize data package, unit 0x%016Lx " 2357 "Oversize data package, unit 0x%016Lx "
2336 "on port 0x%016Lx closed\n", 2358 "on port 0x%016Lx closed\n",
2337 unit->fcp_lun, unit->port->wwpn); 2359 (unsigned long long)unit->fcp_lun,
2360 (unsigned long long)unit->port->wwpn);
2338 zfcp_erp_unit_shutdown(unit, 0, 131, req); 2361 zfcp_erp_unit_shutdown(unit, 0, 131, req);
2339 retval = -EINVAL; 2362 retval = -EINVAL;
2340 } 2363 }
@@ -2397,7 +2420,7 @@ struct zfcp_fsf_req *zfcp_fsf_send_fcp_ctm(struct zfcp_adapter *adapter,
2397 req->qtcb->bottom.io.data_direction = FSF_DATADIR_CMND; 2420 req->qtcb->bottom.io.data_direction = FSF_DATADIR_CMND;
2398 req->qtcb->bottom.io.service_class = FSF_CLASS_3; 2421 req->qtcb->bottom.io.service_class = FSF_CLASS_3;
2399 req->qtcb->bottom.io.fcp_cmnd_length = sizeof(struct fcp_cmnd_iu) + 2422 req->qtcb->bottom.io.fcp_cmnd_length = sizeof(struct fcp_cmnd_iu) +
2400 sizeof(fcp_dl_t); 2423 sizeof(u32);
2401 2424
2402 sbale = zfcp_qdio_sbale_req(req); 2425 sbale = zfcp_qdio_sbale_req(req);
2403 sbale[0].flags |= SBAL_FLAGS0_TYPE_WRITE; 2426 sbale[0].flags |= SBAL_FLAGS0_TYPE_WRITE;