aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libfc/fc_disc.c
diff options
context:
space:
mode:
authorRobert Love <robert.w.love@intel.com>2009-11-03 14:47:39 -0500
committerJames Bottomley <James.Bottomley@suse.de>2009-12-04 13:01:07 -0500
commit3a3b42bf89a9b90ae9ed2c57fdc378e5473a0ef9 (patch)
tree6d41d669a3c7b4a3bb5219ded856251c148e7ab6 /drivers/scsi/libfc/fc_disc.c
parenta51ab39606042e76a483547620699530caa12c40 (diff)
[SCSI] libfc: Formatting cleanups across libfc
This patch makes a variety of cleanup changes to all libfc files. This patch adds kernel-doc headers to all functions lacking them and attempts to better format existing headers. It also add kernel-doc headers to structures. This patch ensures that the current naming conventions for local ports, remote ports and remote port private data is upheld in the following manner. struct instance (i.e. variable name) -------------------------------------------------- fc_lport lport fc_rport rport fc_rport_libfc_priv rpriv fc_rport_priv rdata I also renamed dns_rp and ptp_rp to dns_rdata and ptp_rdata respectively. I used emacs 'indent-region' and 'tabify' on all libfc files to correct spacing alignments. I feel sorry for anyone attempting to review this patch. Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/libfc/fc_disc.c')
-rw-r--r--drivers/scsi/libfc/fc_disc.c78
1 files changed, 38 insertions, 40 deletions
diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c
index a4bdec28fef5..7b790ad15a93 100644
--- a/drivers/scsi/libfc/fc_disc.c
+++ b/drivers/scsi/libfc/fc_disc.c
@@ -53,8 +53,8 @@ static int fc_disc_single(struct fc_lport *, struct fc_disc_port *);
53static void fc_disc_restart(struct fc_disc *); 53static void fc_disc_restart(struct fc_disc *);
54 54
55/** 55/**
56 * fc_disc_stop_rports() - delete all the remote ports associated with the lport 56 * fc_disc_stop_rports() - Delete all the remote ports associated with the lport
57 * @disc: The discovery job to stop rports on 57 * @disc: The discovery job to stop remote ports on
58 * 58 *
59 * Locking Note: This function expects that the lport mutex is locked before 59 * Locking Note: This function expects that the lport mutex is locked before
60 * calling it. 60 * calling it.
@@ -74,9 +74,9 @@ void fc_disc_stop_rports(struct fc_disc *disc)
74 74
75/** 75/**
76 * fc_disc_recv_rscn_req() - Handle Registered State Change Notification (RSCN) 76 * fc_disc_recv_rscn_req() - Handle Registered State Change Notification (RSCN)
77 * @sp: Current sequence of the RSCN exchange 77 * @sp: The sequence of the RSCN exchange
78 * @fp: RSCN Frame 78 * @fp: The RSCN frame
79 * @lport: Fibre Channel host port instance 79 * @lport: The local port that the request will be sent on
80 * 80 *
81 * Locking Note: This function expects that the disc_mutex is locked 81 * Locking Note: This function expects that the disc_mutex is locked
82 * before it is called. 82 * before it is called.
@@ -185,9 +185,9 @@ reject:
185 185
186/** 186/**
187 * fc_disc_recv_req() - Handle incoming requests 187 * fc_disc_recv_req() - Handle incoming requests
188 * @sp: Current sequence of the request exchange 188 * @sp: The sequence of the request exchange
189 * @fp: The frame 189 * @fp: The request frame
190 * @lport: The FC local port 190 * @lport: The local port receiving the request
191 * 191 *
192 * Locking Note: This function is called from the EM and will lock 192 * Locking Note: This function is called from the EM and will lock
193 * the disc_mutex before calling the handler for the 193 * the disc_mutex before calling the handler for the
@@ -215,7 +215,7 @@ static void fc_disc_recv_req(struct fc_seq *sp, struct fc_frame *fp,
215 215
216/** 216/**
217 * fc_disc_restart() - Restart discovery 217 * fc_disc_restart() - Restart discovery
218 * @lport: FC discovery context 218 * @disc: The discovery object to be restarted
219 * 219 *
220 * Locking Note: This function expects that the disc mutex 220 * Locking Note: This function expects that the disc mutex
221 * is already locked. 221 * is already locked.
@@ -242,9 +242,9 @@ static void fc_disc_restart(struct fc_disc *disc)
242} 242}
243 243
244/** 244/**
245 * fc_disc_start() - Fibre Channel Target discovery 245 * fc_disc_start() - Start discovery on a local port
246 * @lport: FC local port 246 * @lport: The local port to have discovery started on
247 * @disc_callback: function to be called when discovery is complete 247 * @disc_callback: Callback function to be called when discovery is complete
248 */ 248 */
249static void fc_disc_start(void (*disc_callback)(struct fc_lport *, 249static void fc_disc_start(void (*disc_callback)(struct fc_lport *,
250 enum fc_disc_event), 250 enum fc_disc_event),
@@ -265,8 +265,8 @@ static void fc_disc_start(void (*disc_callback)(struct fc_lport *,
265 265
266/** 266/**
267 * fc_disc_done() - Discovery has been completed 267 * fc_disc_done() - Discovery has been completed
268 * @disc: FC discovery context 268 * @disc: The discovery context
269 * @event: discovery completion status 269 * @event: The discovery completion status
270 * 270 *
271 * Locking Note: This function expects that the disc mutex is locked before 271 * Locking Note: This function expects that the disc mutex is locked before
272 * it is called. The discovery callback is then made with the lock released, 272 * it is called. The discovery callback is then made with the lock released,
@@ -286,8 +286,8 @@ static void fc_disc_done(struct fc_disc *disc, enum fc_disc_event event)
286 } 286 }
287 287
288 /* 288 /*
289 * Go through all remote ports. If they were found in the latest 289 * Go through all remote ports. If they were found in the latest
290 * discovery, reverify or log them in. Otherwise, log them out. 290 * discovery, reverify or log them in. Otherwise, log them out.
291 * Skip ports which were never discovered. These are the dNS port 291 * Skip ports which were never discovered. These are the dNS port
292 * and ports which were created by PLOGI. 292 * and ports which were created by PLOGI.
293 */ 293 */
@@ -307,8 +307,8 @@ static void fc_disc_done(struct fc_disc *disc, enum fc_disc_event event)
307 307
308/** 308/**
309 * fc_disc_error() - Handle error on dNS request 309 * fc_disc_error() - Handle error on dNS request
310 * @disc: FC discovery context 310 * @disc: The discovery context
311 * @fp: The frame pointer 311 * @fp: The error code encoded as a frame pointer
312 */ 312 */
313static void fc_disc_error(struct fc_disc *disc, struct fc_frame *fp) 313static void fc_disc_error(struct fc_disc *disc, struct fc_frame *fp)
314{ 314{
@@ -344,7 +344,7 @@ static void fc_disc_error(struct fc_disc *disc, struct fc_frame *fp)
344 344
345/** 345/**
346 * fc_disc_gpn_ft_req() - Send Get Port Names by FC-4 type (GPN_FT) request 346 * fc_disc_gpn_ft_req() - Send Get Port Names by FC-4 type (GPN_FT) request
347 * @lport: FC discovery context 347 * @lport: The discovery context
348 * 348 *
349 * Locking Note: This function expects that the disc_mutex is locked 349 * Locking Note: This function expects that the disc_mutex is locked
350 * before it is called. 350 * before it is called.
@@ -378,9 +378,9 @@ err:
378 378
379/** 379/**
380 * fc_disc_gpn_ft_parse() - Parse the body of the dNS GPN_FT response. 380 * fc_disc_gpn_ft_parse() - Parse the body of the dNS GPN_FT response.
381 * @lport: Fibre Channel host port instance 381 * @lport: The local port the GPN_FT was received on
382 * @buf: GPN_FT response buffer 382 * @buf: The GPN_FT response buffer
383 * @len: size of response buffer 383 * @len: The size of response buffer
384 * 384 *
385 * Goes through the list of IDs and names resulting from a request. 385 * Goes through the list of IDs and names resulting from a request.
386 */ 386 */
@@ -479,10 +479,8 @@ static int fc_disc_gpn_ft_parse(struct fc_disc *disc, void *buf, size_t len)
479} 479}
480 480
481/** 481/**
482 * fc_disc_timeout() - Retry handler for the disc component 482 * fc_disc_timeout() - Handler for discovery timeouts
483 * @work: Structure holding disc obj that needs retry discovery 483 * @work: Structure holding discovery context that needs to retry discovery
484 *
485 * Handle retry of memory allocation for remote ports.
486 */ 484 */
487static void fc_disc_timeout(struct work_struct *work) 485static void fc_disc_timeout(struct work_struct *work)
488{ 486{
@@ -496,9 +494,9 @@ static void fc_disc_timeout(struct work_struct *work)
496 494
497/** 495/**
498 * fc_disc_gpn_ft_resp() - Handle a response frame from Get Port Names (GPN_FT) 496 * fc_disc_gpn_ft_resp() - Handle a response frame from Get Port Names (GPN_FT)
499 * @sp: Current sequence of GPN_FT exchange 497 * @sp: The sequence that the GPN_FT response was received on
500 * @fp: response frame 498 * @fp: The GPN_FT response frame
501 * @lp_arg: Fibre Channel host port instance 499 * @lp_arg: The discovery context
502 * 500 *
503 * Locking Note: This function is called without disc mutex held, and 501 * Locking Note: This function is called without disc mutex held, and
504 * should do all its processing with the mutex held 502 * should do all its processing with the mutex held
@@ -569,9 +567,9 @@ static void fc_disc_gpn_ft_resp(struct fc_seq *sp, struct fc_frame *fp,
569 567
570/** 568/**
571 * fc_disc_gpn_id_resp() - Handle a response frame from Get Port Names (GPN_ID) 569 * fc_disc_gpn_id_resp() - Handle a response frame from Get Port Names (GPN_ID)
572 * @sp: exchange sequence 570 * @sp: The sequence the GPN_ID is on
573 * @fp: response frame 571 * @fp: The response frame
574 * @rdata_arg: remote port private data 572 * @rdata_arg: The remote port that sent the GPN_ID response
575 * 573 *
576 * Locking Note: This function is called without disc mutex held. 574 * Locking Note: This function is called without disc mutex held.
577 */ 575 */
@@ -639,7 +637,7 @@ out:
639 637
640/** 638/**
641 * fc_disc_gpn_id_req() - Send Get Port Names by ID (GPN_ID) request 639 * fc_disc_gpn_id_req() - Send Get Port Names by ID (GPN_ID) request
642 * @lport: local port 640 * @lport: The local port to initiate discovery on
643 * @rdata: remote port private data 641 * @rdata: remote port private data
644 * 642 *
645 * Locking Note: This function expects that the disc_mutex is locked 643 * Locking Note: This function expects that the disc_mutex is locked
@@ -656,7 +654,7 @@ static int fc_disc_gpn_id_req(struct fc_lport *lport,
656 if (!fp) 654 if (!fp)
657 return -ENOMEM; 655 return -ENOMEM;
658 if (!lport->tt.elsct_send(lport, rdata->ids.port_id, fp, FC_NS_GPN_ID, 656 if (!lport->tt.elsct_send(lport, rdata->ids.port_id, fp, FC_NS_GPN_ID,
659 fc_disc_gpn_id_resp, rdata, lport->e_d_tov)) 657 fc_disc_gpn_id_resp, rdata, lport->e_d_tov))
660 return -ENOMEM; 658 return -ENOMEM;
661 kref_get(&rdata->kref); 659 kref_get(&rdata->kref);
662 return 0; 660 return 0;
@@ -664,8 +662,8 @@ static int fc_disc_gpn_id_req(struct fc_lport *lport,
664 662
665/** 663/**
666 * fc_disc_single() - Discover the directory information for a single target 664 * fc_disc_single() - Discover the directory information for a single target
667 * @lport: local port 665 * @lport: The local port the remote port is associated with
668 * @dp: The port to rediscover 666 * @dp: The port to rediscover
669 * 667 *
670 * Locking Note: This function expects that the disc_mutex is locked 668 * Locking Note: This function expects that the disc_mutex is locked
671 * before it is called. 669 * before it is called.
@@ -683,7 +681,7 @@ static int fc_disc_single(struct fc_lport *lport, struct fc_disc_port *dp)
683 681
684/** 682/**
685 * fc_disc_stop() - Stop discovery for a given lport 683 * fc_disc_stop() - Stop discovery for a given lport
686 * @lport: The lport that discovery should stop for 684 * @lport: The local port that discovery should stop on
687 */ 685 */
688void fc_disc_stop(struct fc_lport *lport) 686void fc_disc_stop(struct fc_lport *lport)
689{ 687{
@@ -697,7 +695,7 @@ void fc_disc_stop(struct fc_lport *lport)
697 695
698/** 696/**
699 * fc_disc_stop_final() - Stop discovery for a given lport 697 * fc_disc_stop_final() - Stop discovery for a given lport
700 * @lport: The lport that discovery should stop for 698 * @lport: The lport that discovery should stop on
701 * 699 *
702 * This function will block until discovery has been 700 * This function will block until discovery has been
703 * completely stopped and all rports have been deleted. 701 * completely stopped and all rports have been deleted.
@@ -709,8 +707,8 @@ void fc_disc_stop_final(struct fc_lport *lport)
709} 707}
710 708
711/** 709/**
712 * fc_disc_init() - Initialize the discovery block 710 * fc_disc_init() - Initialize the discovery layer for a local port
713 * @lport: FC local port 711 * @lport: The local port that needs the discovery layer to be initialized
714 */ 712 */
715int fc_disc_init(struct fc_lport *lport) 713int fc_disc_init(struct fc_lport *lport)
716{ 714{