aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
authorRobert Love <robert.w.love@intel.com>2009-02-27 13:55:39 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2009-03-06 16:45:32 -0500
commit0ae4d4ae47d2ccbcad813b0d6d8fe12590c7d648 (patch)
treea58434d723ef74a7282c29835dec8496326a14a9 /include/scsi
parentefaf5c085dd2d31757b0ff7886970dfddd8d1808 (diff)
[SCSI] libfc: Cleanup libfc_function_template comments
Made the comments more like the comments for struct scsi_host_template. Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/libfc.h107
1 files changed, 66 insertions, 41 deletions
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index 37df48e13b97..282829cdf352 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -336,31 +336,17 @@ struct fc_exch {
336 336
337struct libfc_function_template { 337struct libfc_function_template {
338 338
339 /**
340 * Mandatory Fields
341 *
342 * These handlers must be implemented by the LLD.
343 */
344
345 /* 339 /*
346 * Interface to send a FC frame 340 * Interface to send a FC frame
347 */
348 int (*frame_send)(struct fc_lport *lp, struct fc_frame *fp);
349
350 /**
351 * Optional Fields
352 * 341 *
353 * The LLD may choose to implement any of the following handlers. 342 * STATUS: REQUIRED
354 * If LLD doesn't specify hander and leaves its pointer NULL then
355 * the default libfc function will be used for that handler.
356 */
357
358 /**
359 * ELS/CT interfaces
360 */ 343 */
344 int (*frame_send)(struct fc_lport *lp, struct fc_frame *fp);
361 345
362 /* 346 /*
363 * elsct_send - sends ELS/CT frame 347 * Interface to send ELS/CT frames
348 *
349 * STATUS: OPTIONAL
364 */ 350 */
365 struct fc_seq *(*elsct_send)(struct fc_lport *lport, 351 struct fc_seq *(*elsct_send)(struct fc_lport *lport,
366 struct fc_rport *rport, 352 struct fc_rport *rport,
@@ -370,9 +356,6 @@ struct libfc_function_template {
370 struct fc_frame *fp, 356 struct fc_frame *fp,
371 void *arg), 357 void *arg),
372 void *arg, u32 timer_msec); 358 void *arg, u32 timer_msec);
373 /**
374 * Exhance Manager interfaces
375 */
376 359
377 /* 360 /*
378 * Send the FC frame payload using a new exchange and sequence. 361 * Send the FC frame payload using a new exchange and sequence.
@@ -404,6 +387,8 @@ struct libfc_function_template {
404 * timer_msec argument is specified. The timer is canceled when 387 * timer_msec argument is specified. The timer is canceled when
405 * it fires or when the exchange is done. The exchange timeout handler 388 * it fires or when the exchange is done. The exchange timeout handler
406 * is registered by EM layer. 389 * is registered by EM layer.
390 *
391 * STATUS: OPTIONAL
407 */ 392 */
408 struct fc_seq *(*exch_seq_send)(struct fc_lport *lp, 393 struct fc_seq *(*exch_seq_send)(struct fc_lport *lp,
409 struct fc_frame *fp, 394 struct fc_frame *fp,
@@ -415,14 +400,18 @@ struct libfc_function_template {
415 void *arg, unsigned int timer_msec); 400 void *arg, unsigned int timer_msec);
416 401
417 /* 402 /*
418 * send a frame using existing sequence and exchange. 403 * Send a frame using an existing sequence and exchange.
404 *
405 * STATUS: OPTIONAL
419 */ 406 */
420 int (*seq_send)(struct fc_lport *lp, struct fc_seq *sp, 407 int (*seq_send)(struct fc_lport *lp, struct fc_seq *sp,
421 struct fc_frame *fp); 408 struct fc_frame *fp);
422 409
423 /* 410 /*
424 * Send ELS response using mainly infomation 411 * Send an ELS response using infomation from a previous
425 * in exchange and sequence in EM layer. 412 * exchange and sequence.
413 *
414 * STATUS: OPTIONAL
426 */ 415 */
427 void (*seq_els_rsp_send)(struct fc_seq *sp, enum fc_els_cmd els_cmd, 416 void (*seq_els_rsp_send)(struct fc_seq *sp, enum fc_els_cmd els_cmd,
428 struct fc_seq_els_data *els_data); 417 struct fc_seq_els_data *els_data);
@@ -434,6 +423,8 @@ struct libfc_function_template {
434 * A timer_msec can be specified for abort timeout, if non-zero 423 * A timer_msec can be specified for abort timeout, if non-zero
435 * timer_msec value is specified then exchange resp handler 424 * timer_msec value is specified then exchange resp handler
436 * will be called with timeout error if no response to abort. 425 * will be called with timeout error if no response to abort.
426 *
427 * STATUS: OPTIONAL
437 */ 428 */
438 int (*seq_exch_abort)(const struct fc_seq *req_sp, 429 int (*seq_exch_abort)(const struct fc_seq *req_sp,
439 unsigned int timer_msec); 430 unsigned int timer_msec);
@@ -441,6 +432,8 @@ struct libfc_function_template {
441 /* 432 /*
442 * Indicate that an exchange/sequence tuple is complete and the memory 433 * Indicate that an exchange/sequence tuple is complete and the memory
443 * allocated for the related objects may be freed. 434 * allocated for the related objects may be freed.
435 *
436 * STATUS: OPTIONAL
444 */ 437 */
445 void (*exch_done)(struct fc_seq *sp); 438 void (*exch_done)(struct fc_seq *sp);
446 439
@@ -448,6 +441,8 @@ struct libfc_function_template {
448 * Assigns a EM and a free XID for an new exchange and then 441 * Assigns a EM and a free XID for an new exchange and then
449 * allocates a new exchange and sequence pair. 442 * allocates a new exchange and sequence pair.
450 * The fp can be used to determine free XID. 443 * The fp can be used to determine free XID.
444 *
445 * STATUS: OPTIONAL
451 */ 446 */
452 struct fc_exch *(*exch_get)(struct fc_lport *lp, struct fc_frame *fp); 447 struct fc_exch *(*exch_get)(struct fc_lport *lp, struct fc_frame *fp);
453 448
@@ -455,12 +450,16 @@ struct libfc_function_template {
455 * Release previously assigned XID by exch_get API. 450 * Release previously assigned XID by exch_get API.
456 * The LLD may implement this if XID is assigned by LLD 451 * The LLD may implement this if XID is assigned by LLD
457 * in exch_get(). 452 * in exch_get().
453 *
454 * STATUS: OPTIONAL
458 */ 455 */
459 void (*exch_put)(struct fc_lport *lp, struct fc_exch_mgr *mp, 456 void (*exch_put)(struct fc_lport *lp, struct fc_exch_mgr *mp,
460 u16 ex_id); 457 u16 ex_id);
461 458
462 /* 459 /*
463 * Start a new sequence on the same exchange/sequence tuple. 460 * Start a new sequence on the same exchange/sequence tuple.
461 *
462 * STATUS: OPTIONAL
464 */ 463 */
465 struct fc_seq *(*seq_start_next)(struct fc_seq *sp); 464 struct fc_seq *(*seq_start_next)(struct fc_seq *sp);
466 465
@@ -468,26 +467,33 @@ struct libfc_function_template {
468 * Reset an exchange manager, completing all sequences and exchanges. 467 * Reset an exchange manager, completing all sequences and exchanges.
469 * If s_id is non-zero, reset only exchanges originating from that FID. 468 * If s_id is non-zero, reset only exchanges originating from that FID.
470 * If d_id is non-zero, reset only exchanges sending to that FID. 469 * If d_id is non-zero, reset only exchanges sending to that FID.
470 *
471 * STATUS: OPTIONAL
471 */ 472 */
472 void (*exch_mgr_reset)(struct fc_lport *, 473 void (*exch_mgr_reset)(struct fc_lport *,
473 u32 s_id, u32 d_id); 474 u32 s_id, u32 d_id);
474 475
475 void (*rport_flush_queue)(void); 476 /*
476 /** 477 * Flush the rport work queue. Generally used before shutdown.
477 * Local Port interfaces 478 *
479 * STATUS: OPTIONAL
478 */ 480 */
481 void (*rport_flush_queue)(void);
479 482
480 /* 483 /*
481 * Receive a frame to a local port. 484 * Receive a frame for a local port.
485 *
486 * STATUS: OPTIONAL
482 */ 487 */
483 void (*lport_recv)(struct fc_lport *lp, struct fc_seq *sp, 488 void (*lport_recv)(struct fc_lport *lp, struct fc_seq *sp,
484 struct fc_frame *fp); 489 struct fc_frame *fp);
485 490
486 int (*lport_reset)(struct fc_lport *); 491 /*
487 492 * Reset the local port.
488 /** 493 *
489 * Remote Port interfaces 494 * STATUS: OPTIONAL
490 */ 495 */
496 int (*lport_reset)(struct fc_lport *);
491 497
492 /* 498 /*
493 * Create a remote port 499 * Create a remote port
@@ -502,26 +508,33 @@ struct libfc_function_template {
502 * - PLOGI 508 * - PLOGI
503 * - PRLI 509 * - PRLI
504 * - RTV 510 * - RTV
511 *
512 * STATUS: OPTIONAL
505 */ 513 */
506 int (*rport_login)(struct fc_rport *rport); 514 int (*rport_login)(struct fc_rport *rport);
507 515
508 /* 516 /*
509 * Logoff, and remove the rport from the transport if 517 * Logoff, and remove the rport from the transport if
510 * it had been added. This will send a LOGO to the target. 518 * it had been added. This will send a LOGO to the target.
519 *
520 * STATUS: OPTIONAL
511 */ 521 */
512 int (*rport_logoff)(struct fc_rport *rport); 522 int (*rport_logoff)(struct fc_rport *rport);
513 523
514 /* 524 /*
515 * Recieve a request from a remote port. 525 * Recieve a request from a remote port.
526 *
527 * STATUS: OPTIONAL
516 */ 528 */
517 void (*rport_recv_req)(struct fc_seq *, struct fc_frame *, 529 void (*rport_recv_req)(struct fc_seq *, struct fc_frame *,
518 struct fc_rport *); 530 struct fc_rport *);
519 531
520 struct fc_rport *(*rport_lookup)(const struct fc_lport *, u32); 532 /*
521 533 * lookup an rport by it's port ID.
522 /** 534 *
523 * FCP interfaces 535 * STATUS: OPTIONAL
524 */ 536 */
537 struct fc_rport *(*rport_lookup)(const struct fc_lport *, u32);
525 538
526 /* 539 /*
527 * Send a fcp cmd from fsp pkt. 540 * Send a fcp cmd from fsp pkt.
@@ -529,30 +542,38 @@ struct libfc_function_template {
529 * 542 *
530 * The resp handler is called when FCP_RSP received. 543 * The resp handler is called when FCP_RSP received.
531 * 544 *
545 * STATUS: OPTIONAL
532 */ 546 */
533 int (*fcp_cmd_send)(struct fc_lport *lp, struct fc_fcp_pkt *fsp, 547 int (*fcp_cmd_send)(struct fc_lport *lp, struct fc_fcp_pkt *fsp,
534 void (*resp)(struct fc_seq *, struct fc_frame *fp, 548 void (*resp)(struct fc_seq *, struct fc_frame *fp,
535 void *arg)); 549 void *arg));
536 550
537 /* 551 /*
538 * Used at least durring linkdown and reset 552 * Cleanup the FCP layer, used durring link down and reset
553 *
554 * STATUS: OPTIONAL
539 */ 555 */
540 void (*fcp_cleanup)(struct fc_lport *lp); 556 void (*fcp_cleanup)(struct fc_lport *lp);
541 557
542 /* 558 /*
543 * Abort all I/O on a local port 559 * Abort all I/O on a local port
560 *
561 * STATUS: OPTIONAL
544 */ 562 */
545 void (*fcp_abort_io)(struct fc_lport *lp); 563 void (*fcp_abort_io)(struct fc_lport *lp);
546 564
547 /** 565 /*
548 * Discovery interfaces 566 * Receive a request for the discovery layer.
567 *
568 * STATUS: OPTIONAL
549 */ 569 */
550
551 void (*disc_recv_req)(struct fc_seq *, 570 void (*disc_recv_req)(struct fc_seq *,
552 struct fc_frame *, struct fc_lport *); 571 struct fc_frame *, struct fc_lport *);
553 572
554 /* 573 /*
555 * Start discovery for a local port. 574 * Start discovery for a local port.
575 *
576 * STATUS: OPTIONAL
556 */ 577 */
557 void (*disc_start)(void (*disc_callback)(struct fc_lport *, 578 void (*disc_start)(void (*disc_callback)(struct fc_lport *,
558 enum fc_disc_event), 579 enum fc_disc_event),
@@ -561,6 +582,8 @@ struct libfc_function_template {
561 /* 582 /*
562 * Stop discovery for a given lport. This will remove 583 * Stop discovery for a given lport. This will remove
563 * all discovered rports 584 * all discovered rports
585 *
586 * STATUS: OPTIONAL
564 */ 587 */
565 void (*disc_stop) (struct fc_lport *); 588 void (*disc_stop) (struct fc_lport *);
566 589
@@ -568,6 +591,8 @@ struct libfc_function_template {
568 * Stop discovery for a given lport. This will block 591 * Stop discovery for a given lport. This will block
569 * until all discovered rports are deleted from the 592 * until all discovered rports are deleted from the
570 * FC transport class 593 * FC transport class
594 *
595 * STATUS: OPTIONAL
571 */ 596 */
572 void (*disc_stop_final) (struct fc_lport *); 597 void (*disc_stop_final) (struct fc_lport *);
573}; 598};