diff options
author | Jing Huang <huangj@brocade.com> | 2010-07-08 23:02:55 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-07-27 13:04:32 -0400 |
commit | ab2a9ba189e889b3e8990e52e90d2cd9606b2aa1 (patch) | |
tree | 0114a0fcb8caf0daee0fa23a8d9b788ad1eef0f2 /drivers/scsi/bfa/bfad.c | |
parent | 08a17ced7a78064f4f03de7d68b8cd32581f0510 (diff) |
[SCSI] bfa: add debugfs support
- Add debugfs support to obtain firmware trace, driver trace
and read/write to registers.
- debugfs hierarchy:
/sys/kernel/debug/bfa/host#
where the host number corresponds to the one under /sys/class/scsi_host/host#
- Following are the new debugfs entries added:
drvtrc: collect current driver trace
fwtrc: collect current firmware trace.
fwsave: collect last saved fw trace as a result of firmware crash.
regwr: write one word to chip register
regrd: read one or more words from chip register.
Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/bfa/bfad.c')
-rw-r--r-- | drivers/scsi/bfa/bfad.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c index a17800e6277d..915a29d6c7ad 100644 --- a/drivers/scsi/bfa/bfad.c +++ b/drivers/scsi/bfa/bfad.c | |||
@@ -57,6 +57,7 @@ static int ipfc_enable = BFA_FALSE; | |||
57 | static int fdmi_enable = BFA_TRUE; | 57 | static int fdmi_enable = BFA_TRUE; |
58 | int bfa_lun_queue_depth = BFAD_LUN_QUEUE_DEPTH; | 58 | int bfa_lun_queue_depth = BFAD_LUN_QUEUE_DEPTH; |
59 | int bfa_linkup_delay = -1; | 59 | int bfa_linkup_delay = -1; |
60 | int bfa_debugfs_enable = 1; | ||
60 | 61 | ||
61 | module_param(os_name, charp, S_IRUGO | S_IWUSR); | 62 | module_param(os_name, charp, S_IRUGO | S_IWUSR); |
62 | MODULE_PARM_DESC(os_name, "OS name of the hba host machine"); | 63 | MODULE_PARM_DESC(os_name, "OS name of the hba host machine"); |
@@ -106,6 +107,9 @@ MODULE_PARM_DESC(bfa_linkup_delay, "Link up delay, default=30 secs for boot" | |||
106 | module_param(fdmi_enable, int, S_IRUGO | S_IWUSR); | 107 | module_param(fdmi_enable, int, S_IRUGO | S_IWUSR); |
107 | MODULE_PARM_DESC(fdmi_enable, "Enables fdmi registration, default=1," | 108 | MODULE_PARM_DESC(fdmi_enable, "Enables fdmi registration, default=1," |
108 | " Range[false:0|true:1]"); | 109 | " Range[false:0|true:1]"); |
110 | module_param(bfa_debugfs_enable, int, S_IRUGO | S_IWUSR); | ||
111 | MODULE_PARM_DESC(bfa_debugfs_enable, "Enables debugfs feature, default=1," | ||
112 | " Range[false:0|true:1]"); | ||
109 | 113 | ||
110 | /* | 114 | /* |
111 | * Stores the module parm num_sgpgs value; | 115 | * Stores the module parm num_sgpgs value; |
@@ -903,6 +907,10 @@ bfad_cfg_pport(struct bfad_s *bfad, enum bfa_port_role role) | |||
903 | bfad->pport.roles |= BFA_PORT_ROLE_FCP_IM; | 907 | bfad->pport.roles |= BFA_PORT_ROLE_FCP_IM; |
904 | } | 908 | } |
905 | 909 | ||
910 | /* Setup the debugfs node for this scsi_host */ | ||
911 | if (bfa_debugfs_enable) | ||
912 | bfad_debugfs_init(&bfad->pport); | ||
913 | |||
906 | bfad->bfad_flags |= BFAD_CFG_PPORT_DONE; | 914 | bfad->bfad_flags |= BFAD_CFG_PPORT_DONE; |
907 | 915 | ||
908 | out: | 916 | out: |
@@ -912,6 +920,10 @@ out: | |||
912 | void | 920 | void |
913 | bfad_uncfg_pport(struct bfad_s *bfad) | 921 | bfad_uncfg_pport(struct bfad_s *bfad) |
914 | { | 922 | { |
923 | /* Remove the debugfs node for this scsi_host */ | ||
924 | kfree(bfad->regdata); | ||
925 | bfad_debugfs_exit(&bfad->pport); | ||
926 | |||
915 | if ((bfad->pport.roles & BFA_PORT_ROLE_FCP_IPFC) && ipfc_enable) { | 927 | if ((bfad->pport.roles & BFA_PORT_ROLE_FCP_IPFC) && ipfc_enable) { |
916 | bfad_ipfc_port_delete(bfad, &bfad->pport); | 928 | bfad_ipfc_port_delete(bfad, &bfad->pport); |
917 | bfad->pport.roles &= ~BFA_PORT_ROLE_FCP_IPFC; | 929 | bfad->pport.roles &= ~BFA_PORT_ROLE_FCP_IPFC; |