zfcp_fc.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558
  1. /*
  2. * zfcp device driver
  3. *
  4. * Fibre Channel related functions for the zfcp device driver.
  5. *
  6. * Copyright IBM Corporation 2008
  7. */
  8. #include "zfcp_ext.h"
  9. struct ct_iu_gpn_ft_req {
  10. struct ct_hdr header;
  11. u8 flags;
  12. u8 domain_id_scope;
  13. u8 area_id_scope;
  14. u8 fc4_type;
  15. } __attribute__ ((packed));
  16. struct gpn_ft_resp_acc {
  17. u8 control;
  18. u8 port_id[3];
  19. u8 reserved[4];
  20. u64 wwpn;
  21. } __attribute__ ((packed));
  22. #define ZFCP_GPN_FT_ENTRIES ((PAGE_SIZE - sizeof(struct ct_hdr)) \
  23. / sizeof(struct gpn_ft_resp_acc))
  24. #define ZFCP_GPN_FT_BUFFERS 4
  25. #define ZFCP_GPN_FT_MAX_ENTRIES ZFCP_GPN_FT_BUFFERS * (ZFCP_GPN_FT_ENTRIES + 1)
  26. struct ct_iu_gpn_ft_resp {
  27. struct ct_hdr header;
  28. struct gpn_ft_resp_acc accept[ZFCP_GPN_FT_ENTRIES];
  29. } __attribute__ ((packed));
  30. struct zfcp_gpn_ft {
  31. struct zfcp_send_ct ct;
  32. struct scatterlist sg_req;
  33. struct scatterlist sg_resp[ZFCP_GPN_FT_BUFFERS];
  34. };
  35. static void _zfcp_fc_incoming_rscn(struct zfcp_fsf_req *fsf_req, u32 range,
  36. struct fcp_rscn_element *elem)
  37. {
  38. unsigned long flags;
  39. struct zfcp_port *port;
  40. read_lock_irqsave(&zfcp_data.config_lock, flags);
  41. list_for_each_entry(port, &fsf_req->adapter->port_list_head, list) {
  42. if (atomic_test_mask(ZFCP_STATUS_PORT_WKA, &port->status))
  43. continue;
  44. /* FIXME: ZFCP_STATUS_PORT_DID_DID check is racy */
  45. if (!atomic_test_mask(ZFCP_STATUS_PORT_DID_DID, &port->status))
  46. /* Try to connect to unused ports anyway. */
  47. zfcp_erp_port_reopen(port,
  48. ZFCP_STATUS_COMMON_ERP_FAILED,
  49. 82, fsf_req);
  50. else if ((port->d_id & range) == (elem->nport_did & range))
  51. /* Check connection status for connected ports */
  52. zfcp_test_link(port);
  53. }
  54. read_unlock_irqrestore(&zfcp_data.config_lock, flags);
  55. }
  56. static void zfcp_fc_incoming_rscn(struct zfcp_fsf_req *fsf_req)
  57. {
  58. struct fsf_status_read_buffer *status_buffer = (void *)fsf_req->data;
  59. struct fcp_rscn_head *fcp_rscn_head;
  60. struct fcp_rscn_element *fcp_rscn_element;
  61. u16 i;
  62. u16 no_entries;
  63. u32 range_mask;
  64. fcp_rscn_head = (struct fcp_rscn_head *) status_buffer->payload.data;
  65. fcp_rscn_element = (struct fcp_rscn_element *) fcp_rscn_head;
  66. /* see FC-FS */
  67. no_entries = fcp_rscn_head->payload_len /
  68. sizeof(struct fcp_rscn_element);
  69. for (i = 1; i < no_entries; i++) {
  70. /* skip head and start with 1st element */
  71. fcp_rscn_element++;
  72. switch (fcp_rscn_element->addr_format) {
  73. case ZFCP_PORT_ADDRESS:
  74. range_mask = ZFCP_PORTS_RANGE_PORT;
  75. break;
  76. case ZFCP_AREA_ADDRESS:
  77. range_mask = ZFCP_PORTS_RANGE_AREA;
  78. break;
  79. case ZFCP_DOMAIN_ADDRESS:
  80. range_mask = ZFCP_PORTS_RANGE_DOMAIN;
  81. break;
  82. case ZFCP_FABRIC_ADDRESS:
  83. range_mask = ZFCP_PORTS_RANGE_FABRIC;
  84. break;
  85. default:
  86. continue;
  87. }
  88. _zfcp_fc_incoming_rscn(fsf_req, range_mask, fcp_rscn_element);
  89. }
  90. schedule_work(&fsf_req->adapter->scan_work);
  91. }
  92. static void zfcp_fc_incoming_wwpn(struct zfcp_fsf_req *req, wwn_t wwpn)
  93. {
  94. struct zfcp_adapter *adapter = req->adapter;
  95. struct zfcp_port *port;
  96. unsigned long flags;
  97. read_lock_irqsave(&zfcp_data.config_lock, flags);
  98. list_for_each_entry(port, &adapter->port_list_head, list)
  99. if (port->wwpn == wwpn)
  100. break;
  101. read_unlock_irqrestore(&zfcp_data.config_lock, flags);
  102. if (port && (port->wwpn == wwpn))
  103. zfcp_erp_port_forced_reopen(port, 0, 83, req);
  104. }
  105. static void zfcp_fc_incoming_plogi(struct zfcp_fsf_req *req)
  106. {
  107. struct fsf_status_read_buffer *status_buffer =
  108. (struct fsf_status_read_buffer *)req->data;
  109. struct fsf_plogi *els_plogi =
  110. (struct fsf_plogi *) status_buffer->payload.data;
  111. zfcp_fc_incoming_wwpn(req, els_plogi->serv_param.wwpn);
  112. }
  113. static void zfcp_fc_incoming_logo(struct zfcp_fsf_req *req)
  114. {
  115. struct fsf_status_read_buffer *status_buffer =
  116. (struct fsf_status_read_buffer *)req->data;
  117. struct fcp_logo *els_logo =
  118. (struct fcp_logo *) status_buffer->payload.data;
  119. zfcp_fc_incoming_wwpn(req, els_logo->nport_wwpn);
  120. }
  121. /**
  122. * zfcp_fc_incoming_els - handle incoming ELS
  123. * @fsf_req - request which contains incoming ELS
  124. */
  125. void zfcp_fc_incoming_els(struct zfcp_fsf_req *fsf_req)
  126. {
  127. struct fsf_status_read_buffer *status_buffer =
  128. (struct fsf_status_read_buffer *) fsf_req->data;
  129. unsigned int els_type = status_buffer->payload.data[0];
  130. zfcp_san_dbf_event_incoming_els(fsf_req);
  131. if (els_type == LS_PLOGI)
  132. zfcp_fc_incoming_plogi(fsf_req);
  133. else if (els_type == LS_LOGO)
  134. zfcp_fc_incoming_logo(fsf_req);
  135. else if (els_type == LS_RSCN)
  136. zfcp_fc_incoming_rscn(fsf_req);
  137. }
  138. static void zfcp_ns_gid_pn_handler(unsigned long data)
  139. {
  140. struct zfcp_gid_pn_data *gid_pn = (struct zfcp_gid_pn_data *) data;
  141. struct zfcp_send_ct *ct = &gid_pn->ct;
  142. struct ct_iu_gid_pn_req *ct_iu_req = sg_virt(ct->req);
  143. struct ct_iu_gid_pn_resp *ct_iu_resp = sg_virt(ct->resp);
  144. struct zfcp_port *port = gid_pn->port;
  145. if (ct->status)
  146. goto out;
  147. if (ct_iu_resp->header.cmd_rsp_code != ZFCP_CT_ACCEPT) {
  148. atomic_set_mask(ZFCP_STATUS_PORT_INVALID_WWPN, &port->status);
  149. goto out;
  150. }
  151. /* paranoia */
  152. if (ct_iu_req->wwpn != port->wwpn)
  153. goto out;
  154. /* looks like a valid d_id */
  155. port->d_id = ct_iu_resp->d_id & ZFCP_DID_MASK;
  156. atomic_set_mask(ZFCP_STATUS_PORT_DID_DID, &port->status);
  157. out:
  158. mempool_free(gid_pn, port->adapter->pool.data_gid_pn);
  159. }
  160. /**
  161. * zfcp_fc_ns_gid_pn_request - initiate GID_PN nameserver request
  162. * @erp_action: pointer to zfcp_erp_action where GID_PN request is needed
  163. * return: -ENOMEM on error, 0 otherwise
  164. */
  165. int zfcp_fc_ns_gid_pn_request(struct zfcp_erp_action *erp_action)
  166. {
  167. int ret;
  168. struct zfcp_gid_pn_data *gid_pn;
  169. struct zfcp_adapter *adapter = erp_action->adapter;
  170. gid_pn = mempool_alloc(adapter->pool.data_gid_pn, GFP_ATOMIC);
  171. if (!gid_pn)
  172. return -ENOMEM;
  173. memset(gid_pn, 0, sizeof(*gid_pn));
  174. /* setup parameters for send generic command */
  175. gid_pn->port = erp_action->port;
  176. gid_pn->ct.port = adapter->nameserver_port;
  177. gid_pn->ct.handler = zfcp_ns_gid_pn_handler;
  178. gid_pn->ct.handler_data = (unsigned long) gid_pn;
  179. gid_pn->ct.timeout = ZFCP_NS_GID_PN_TIMEOUT;
  180. gid_pn->ct.req = &gid_pn->req;
  181. gid_pn->ct.resp = &gid_pn->resp;
  182. gid_pn->ct.req_count = 1;
  183. gid_pn->ct.resp_count = 1;
  184. sg_init_one(&gid_pn->req, &gid_pn->ct_iu_req,
  185. sizeof(struct ct_iu_gid_pn_req));
  186. sg_init_one(&gid_pn->resp, &gid_pn->ct_iu_resp,
  187. sizeof(struct ct_iu_gid_pn_resp));
  188. /* setup nameserver request */
  189. gid_pn->ct_iu_req.header.revision = ZFCP_CT_REVISION;
  190. gid_pn->ct_iu_req.header.gs_type = ZFCP_CT_DIRECTORY_SERVICE;
  191. gid_pn->ct_iu_req.header.gs_subtype = ZFCP_CT_NAME_SERVER;
  192. gid_pn->ct_iu_req.header.options = ZFCP_CT_SYNCHRONOUS;
  193. gid_pn->ct_iu_req.header.cmd_rsp_code = ZFCP_CT_GID_PN;
  194. gid_pn->ct_iu_req.header.max_res_size = ZFCP_CT_MAX_SIZE;
  195. gid_pn->ct_iu_req.wwpn = erp_action->port->wwpn;
  196. ret = zfcp_fsf_send_ct(&gid_pn->ct, adapter->pool.fsf_req_erp,
  197. erp_action);
  198. if (ret)
  199. mempool_free(gid_pn, adapter->pool.data_gid_pn);
  200. return ret;
  201. }
  202. /**
  203. * zfcp_fc_plogi_evaluate - evaluate PLOGI playload
  204. * @port: zfcp_port structure
  205. * @plogi: plogi payload
  206. *
  207. * Evaluate PLOGI playload and copy important fields into zfcp_port structure
  208. */
  209. void zfcp_fc_plogi_evaluate(struct zfcp_port *port, struct fsf_plogi *plogi)
  210. {
  211. port->maxframe_size = plogi->serv_param.common_serv_param[7] |
  212. ((plogi->serv_param.common_serv_param[6] & 0x0F) << 8);
  213. if (plogi->serv_param.class1_serv_param[0] & 0x80)
  214. port->supported_classes |= FC_COS_CLASS1;
  215. if (plogi->serv_param.class2_serv_param[0] & 0x80)
  216. port->supported_classes |= FC_COS_CLASS2;
  217. if (plogi->serv_param.class3_serv_param[0] & 0x80)
  218. port->supported_classes |= FC_COS_CLASS3;
  219. if (plogi->serv_param.class4_serv_param[0] & 0x80)
  220. port->supported_classes |= FC_COS_CLASS4;
  221. }
  222. struct zfcp_els_adisc {
  223. struct zfcp_send_els els;
  224. struct scatterlist req;
  225. struct scatterlist resp;
  226. struct zfcp_ls_adisc ls_adisc;
  227. struct zfcp_ls_adisc_acc ls_adisc_acc;
  228. };
  229. static void zfcp_fc_adisc_handler(unsigned long data)
  230. {
  231. struct zfcp_els_adisc *adisc = (struct zfcp_els_adisc *) data;
  232. struct zfcp_port *port = adisc->els.port;
  233. struct zfcp_ls_adisc_acc *ls_adisc = &adisc->ls_adisc_acc;
  234. if (adisc->els.status) {
  235. /* request rejected or timed out */
  236. zfcp_erp_port_forced_reopen(port, 0, 63, NULL);
  237. goto out;
  238. }
  239. if (!port->wwnn)
  240. port->wwnn = ls_adisc->wwnn;
  241. if (port->wwpn != ls_adisc->wwpn)
  242. zfcp_erp_port_reopen(port, 0, 64, NULL);
  243. out:
  244. zfcp_port_put(port);
  245. kfree(adisc);
  246. }
  247. static int zfcp_fc_adisc(struct zfcp_port *port)
  248. {
  249. struct zfcp_els_adisc *adisc;
  250. struct zfcp_adapter *adapter = port->adapter;
  251. adisc = kzalloc(sizeof(struct zfcp_els_adisc), GFP_ATOMIC);
  252. if (!adisc)
  253. return -ENOMEM;
  254. adisc->els.req = &adisc->req;
  255. adisc->els.resp = &adisc->resp;
  256. sg_init_one(adisc->els.req, &adisc->ls_adisc,
  257. sizeof(struct zfcp_ls_adisc));
  258. sg_init_one(adisc->els.resp, &adisc->ls_adisc_acc,
  259. sizeof(struct zfcp_ls_adisc_acc));
  260. adisc->els.req_count = 1;
  261. adisc->els.resp_count = 1;
  262. adisc->els.adapter = adapter;
  263. adisc->els.port = port;
  264. adisc->els.d_id = port->d_id;
  265. adisc->els.handler = zfcp_fc_adisc_handler;
  266. adisc->els.handler_data = (unsigned long) adisc;
  267. adisc->els.ls_code = adisc->ls_adisc.code = ZFCP_LS_ADISC;
  268. /* acc. to FC-FS, hard_nport_id in ADISC should not be set for ports
  269. without FC-AL-2 capability, so we don't set it */
  270. adisc->ls_adisc.wwpn = fc_host_port_name(adapter->scsi_host);
  271. adisc->ls_adisc.wwnn = fc_host_node_name(adapter->scsi_host);
  272. adisc->ls_adisc.nport_id = fc_host_port_id(adapter->scsi_host);
  273. return zfcp_fsf_send_els(&adisc->els);
  274. }
  275. /**
  276. * zfcp_test_link - lightweight link test procedure
  277. * @port: port to be tested
  278. *
  279. * Test status of a link to a remote port using the ELS command ADISC.
  280. * If there is a problem with the remote port, error recovery steps
  281. * will be triggered.
  282. */
  283. void zfcp_test_link(struct zfcp_port *port)
  284. {
  285. int retval;
  286. zfcp_port_get(port);
  287. retval = zfcp_fc_adisc(port);
  288. if (retval == 0)
  289. return;
  290. /* send of ADISC was not possible */
  291. zfcp_port_put(port);
  292. if (retval != -EBUSY)
  293. zfcp_erp_port_forced_reopen(port, 0, 65, NULL);
  294. }
  295. static int zfcp_scan_get_nameserver(struct zfcp_adapter *adapter)
  296. {
  297. int ret;
  298. if (!adapter->nameserver_port)
  299. return -EINTR;
  300. if (!atomic_test_mask(ZFCP_STATUS_COMMON_UNBLOCKED,
  301. &adapter->nameserver_port->status)) {
  302. ret = zfcp_erp_port_reopen(adapter->nameserver_port, 0, 148,
  303. NULL);
  304. if (ret)
  305. return ret;
  306. zfcp_erp_wait(adapter);
  307. }
  308. return !atomic_test_mask(ZFCP_STATUS_COMMON_UNBLOCKED,
  309. &adapter->nameserver_port->status);
  310. }
  311. static void zfcp_gpn_ft_handler(unsigned long _done)
  312. {
  313. complete((struct completion *)_done);
  314. }
  315. static void zfcp_free_sg_env(struct zfcp_gpn_ft *gpn_ft)
  316. {
  317. struct scatterlist *sg = &gpn_ft->sg_req;
  318. kfree(sg_virt(sg)); /* free request buffer */
  319. zfcp_sg_free_table(gpn_ft->sg_resp, ZFCP_GPN_FT_BUFFERS);
  320. kfree(gpn_ft);
  321. }
  322. static struct zfcp_gpn_ft *zfcp_alloc_sg_env(void)
  323. {
  324. struct zfcp_gpn_ft *gpn_ft;
  325. struct ct_iu_gpn_ft_req *req;
  326. gpn_ft = kzalloc(sizeof(*gpn_ft), GFP_KERNEL);
  327. if (!gpn_ft)
  328. return NULL;
  329. req = kzalloc(sizeof(struct ct_iu_gpn_ft_req), GFP_KERNEL);
  330. if (!req) {
  331. kfree(gpn_ft);
  332. gpn_ft = NULL;
  333. goto out;
  334. }
  335. sg_init_one(&gpn_ft->sg_req, req, sizeof(*req));
  336. if (zfcp_sg_setup_table(gpn_ft->sg_resp, ZFCP_GPN_FT_BUFFERS)) {
  337. zfcp_free_sg_env(gpn_ft);
  338. gpn_ft = NULL;
  339. }
  340. out:
  341. return gpn_ft;
  342. }
  343. static int zfcp_scan_issue_gpn_ft(struct zfcp_gpn_ft *gpn_ft,
  344. struct zfcp_adapter *adapter)
  345. {
  346. struct zfcp_send_ct *ct = &gpn_ft->ct;
  347. struct ct_iu_gpn_ft_req *req = sg_virt(&gpn_ft->sg_req);
  348. struct completion done;
  349. int ret;
  350. /* prepare CT IU for GPN_FT */
  351. req->header.revision = ZFCP_CT_REVISION;
  352. req->header.gs_type = ZFCP_CT_DIRECTORY_SERVICE;
  353. req->header.gs_subtype = ZFCP_CT_NAME_SERVER;
  354. req->header.options = ZFCP_CT_SYNCHRONOUS;
  355. req->header.cmd_rsp_code = ZFCP_CT_GPN_FT;
  356. req->header.max_res_size = (sizeof(struct gpn_ft_resp_acc) *
  357. (ZFCP_GPN_FT_MAX_ENTRIES - 1)) >> 2;
  358. req->flags = 0;
  359. req->domain_id_scope = 0;
  360. req->area_id_scope = 0;
  361. req->fc4_type = ZFCP_CT_SCSI_FCP;
  362. /* prepare zfcp_send_ct */
  363. ct->port = adapter->nameserver_port;
  364. ct->handler = zfcp_gpn_ft_handler;
  365. ct->handler_data = (unsigned long)&done;
  366. ct->timeout = 10;
  367. ct->req = &gpn_ft->sg_req;
  368. ct->resp = gpn_ft->sg_resp;
  369. ct->req_count = 1;
  370. ct->resp_count = ZFCP_GPN_FT_BUFFERS;
  371. init_completion(&done);
  372. ret = zfcp_fsf_send_ct(ct, NULL, NULL);
  373. if (!ret)
  374. wait_for_completion(&done);
  375. return ret;
  376. }
  377. static void zfcp_validate_port(struct zfcp_port *port)
  378. {
  379. struct zfcp_adapter *adapter = port->adapter;
  380. atomic_clear_mask(ZFCP_STATUS_COMMON_NOESC, &port->status);
  381. if (port == adapter->nameserver_port)
  382. return;
  383. if ((port->supported_classes != 0) || (port->units != 0)) {
  384. zfcp_port_put(port);
  385. return;
  386. }
  387. zfcp_erp_port_shutdown(port, 0, 151, NULL);
  388. zfcp_erp_wait(adapter);
  389. zfcp_port_put(port);
  390. zfcp_port_dequeue(port);
  391. }
  392. static int zfcp_scan_eval_gpn_ft(struct zfcp_gpn_ft *gpn_ft)
  393. {
  394. struct zfcp_send_ct *ct = &gpn_ft->ct;
  395. struct scatterlist *sg = gpn_ft->sg_resp;
  396. struct ct_hdr *hdr = sg_virt(sg);
  397. struct gpn_ft_resp_acc *acc = sg_virt(sg);
  398. struct zfcp_adapter *adapter = ct->port->adapter;
  399. struct zfcp_port *port, *tmp;
  400. u32 d_id;
  401. int ret = 0, x, last = 0;
  402. if (ct->status)
  403. return -EIO;
  404. if (hdr->cmd_rsp_code != ZFCP_CT_ACCEPT) {
  405. if (hdr->reason_code == ZFCP_CT_UNABLE_TO_PERFORM_CMD)
  406. return -EAGAIN; /* might be a temporary condition */
  407. return -EIO;
  408. }
  409. if (hdr->max_res_size)
  410. return -E2BIG;
  411. down(&zfcp_data.config_sema);
  412. /* first entry is the header */
  413. for (x = 1; x < ZFCP_GPN_FT_MAX_ENTRIES && !last; x++) {
  414. if (x % (ZFCP_GPN_FT_ENTRIES + 1))
  415. acc++;
  416. else
  417. acc = sg_virt(++sg);
  418. last = acc->control & 0x80;
  419. d_id = acc->port_id[0] << 16 | acc->port_id[1] << 8 |
  420. acc->port_id[2];
  421. /* skip the adapter's port and known remote ports */
  422. if (acc->wwpn == fc_host_port_name(adapter->scsi_host))
  423. continue;
  424. port = zfcp_get_port_by_wwpn(adapter, acc->wwpn);
  425. if (port) {
  426. zfcp_port_get(port);
  427. continue;
  428. }
  429. port = zfcp_port_enqueue(adapter, acc->wwpn,
  430. ZFCP_STATUS_PORT_DID_DID |
  431. ZFCP_STATUS_COMMON_NOESC, d_id);
  432. if (IS_ERR(port))
  433. ret = PTR_ERR(port);
  434. else
  435. zfcp_erp_port_reopen(port, 0, 149, NULL);
  436. }
  437. zfcp_erp_wait(adapter);
  438. list_for_each_entry_safe(port, tmp, &adapter->port_list_head, list)
  439. zfcp_validate_port(port);
  440. up(&zfcp_data.config_sema);
  441. return ret;
  442. }
  443. /**
  444. * zfcp_scan_ports - scan remote ports and attach new ports
  445. * @adapter: pointer to struct zfcp_adapter
  446. */
  447. int zfcp_scan_ports(struct zfcp_adapter *adapter)
  448. {
  449. int ret, i;
  450. struct zfcp_gpn_ft *gpn_ft;
  451. zfcp_erp_wait(adapter); /* wait until adapter is finished with ERP */
  452. if (fc_host_port_type(adapter->scsi_host) != FC_PORTTYPE_NPORT)
  453. return 0;
  454. ret = zfcp_scan_get_nameserver(adapter);
  455. if (ret)
  456. return ret;
  457. gpn_ft = zfcp_alloc_sg_env();
  458. if (!gpn_ft)
  459. return -ENOMEM;
  460. for (i = 0; i < 3; i++) {
  461. ret = zfcp_scan_issue_gpn_ft(gpn_ft, adapter);
  462. if (!ret) {
  463. ret = zfcp_scan_eval_gpn_ft(gpn_ft);
  464. if (ret == -EAGAIN)
  465. ssleep(1);
  466. else
  467. break;
  468. }
  469. }
  470. zfcp_free_sg_env(gpn_ft);
  471. return ret;
  472. }
  473. void _zfcp_scan_ports_later(struct work_struct *work)
  474. {
  475. zfcp_scan_ports(container_of(work, struct zfcp_adapter, scan_work));
  476. }