diff options
Diffstat (limited to 'drivers/message/fusion/mptbase.c')
| -rw-r--r-- | drivers/message/fusion/mptbase.c | 241 |
1 files changed, 120 insertions, 121 deletions
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index b88a244a1edd..b8f1719d7c02 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c | |||
| @@ -50,6 +50,7 @@ | |||
| 50 | #include <linux/module.h> | 50 | #include <linux/module.h> |
| 51 | #include <linux/errno.h> | 51 | #include <linux/errno.h> |
| 52 | #include <linux/init.h> | 52 | #include <linux/init.h> |
| 53 | #include <linux/seq_file.h> | ||
| 53 | #include <linux/slab.h> | 54 | #include <linux/slab.h> |
| 54 | #include <linux/types.h> | 55 | #include <linux/types.h> |
| 55 | #include <linux/pci.h> | 56 | #include <linux/pci.h> |
| @@ -109,8 +110,7 @@ MODULE_PARM_DESC(mpt_debug_level, " debug level - refer to mptdebug.h \ | |||
| 109 | 110 | ||
| 110 | int mpt_fwfault_debug; | 111 | int mpt_fwfault_debug; |
| 111 | EXPORT_SYMBOL(mpt_fwfault_debug); | 112 | EXPORT_SYMBOL(mpt_fwfault_debug); |
| 112 | module_param_call(mpt_fwfault_debug, param_set_int, param_get_int, | 113 | module_param(mpt_fwfault_debug, int, 0600); |
| 113 | &mpt_fwfault_debug, 0600); | ||
| 114 | MODULE_PARM_DESC(mpt_fwfault_debug, "Enable detection of Firmware fault" | 114 | MODULE_PARM_DESC(mpt_fwfault_debug, "Enable detection of Firmware fault" |
| 115 | " and halt Firmware on fault - (default=0)"); | 115 | " and halt Firmware on fault - (default=0)"); |
| 116 | 116 | ||
| @@ -200,12 +200,9 @@ static int mpt_host_page_access_control(MPT_ADAPTER *ioc, u8 access_control_valu | |||
| 200 | static int mpt_host_page_alloc(MPT_ADAPTER *ioc, pIOCInit_t ioc_init); | 200 | static int mpt_host_page_alloc(MPT_ADAPTER *ioc, pIOCInit_t ioc_init); |
| 201 | 201 | ||
| 202 | #ifdef CONFIG_PROC_FS | 202 | #ifdef CONFIG_PROC_FS |
| 203 | static int procmpt_summary_read(char *buf, char **start, off_t offset, | 203 | static const struct file_operations mpt_summary_proc_fops; |
| 204 | int request, int *eof, void *data); | 204 | static const struct file_operations mpt_version_proc_fops; |
| 205 | static int procmpt_version_read(char *buf, char **start, off_t offset, | 205 | static const struct file_operations mpt_iocinfo_proc_fops; |
| 206 | int request, int *eof, void *data); | ||
| 207 | static int procmpt_iocinfo_read(char *buf, char **start, off_t offset, | ||
| 208 | int request, int *eof, void *data); | ||
| 209 | #endif | 206 | #endif |
| 210 | static void mpt_get_fw_exp_ver(char *buf, MPT_ADAPTER *ioc); | 207 | static void mpt_get_fw_exp_ver(char *buf, MPT_ADAPTER *ioc); |
| 211 | 208 | ||
| @@ -1725,7 +1722,7 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) | |||
| 1725 | u8 pcixcmd; | 1722 | u8 pcixcmd; |
| 1726 | static int mpt_ids = 0; | 1723 | static int mpt_ids = 0; |
| 1727 | #ifdef CONFIG_PROC_FS | 1724 | #ifdef CONFIG_PROC_FS |
| 1728 | struct proc_dir_entry *dent, *ent; | 1725 | struct proc_dir_entry *dent; |
| 1729 | #endif | 1726 | #endif |
| 1730 | 1727 | ||
| 1731 | ioc = kzalloc(sizeof(MPT_ADAPTER), GFP_ATOMIC); | 1728 | ioc = kzalloc(sizeof(MPT_ADAPTER), GFP_ATOMIC); |
| @@ -1980,16 +1977,8 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) | |||
| 1980 | */ | 1977 | */ |
| 1981 | dent = proc_mkdir(ioc->name, mpt_proc_root_dir); | 1978 | dent = proc_mkdir(ioc->name, mpt_proc_root_dir); |
| 1982 | if (dent) { | 1979 | if (dent) { |
| 1983 | ent = create_proc_entry("info", S_IFREG|S_IRUGO, dent); | 1980 | proc_create_data("info", S_IRUGO, dent, &mpt_iocinfo_proc_fops, ioc); |
| 1984 | if (ent) { | 1981 | proc_create_data("summary", S_IRUGO, dent, &mpt_summary_proc_fops, ioc); |
| 1985 | ent->read_proc = procmpt_iocinfo_read; | ||
| 1986 | ent->data = ioc; | ||
| 1987 | } | ||
| 1988 | ent = create_proc_entry("summary", S_IFREG|S_IRUGO, dent); | ||
| 1989 | if (ent) { | ||
| 1990 | ent->read_proc = procmpt_summary_read; | ||
| 1991 | ent->data = ioc; | ||
| 1992 | } | ||
| 1993 | } | 1982 | } |
| 1994 | #endif | 1983 | #endif |
| 1995 | 1984 | ||
| @@ -6546,20 +6535,12 @@ mpt_ioc_reset(MPT_ADAPTER *ioc, int reset_phase) | |||
| 6546 | static int | 6535 | static int |
| 6547 | procmpt_create(void) | 6536 | procmpt_create(void) |
| 6548 | { | 6537 | { |
| 6549 | struct proc_dir_entry *ent; | ||
| 6550 | |||
| 6551 | mpt_proc_root_dir = proc_mkdir(MPT_PROCFS_MPTBASEDIR, NULL); | 6538 | mpt_proc_root_dir = proc_mkdir(MPT_PROCFS_MPTBASEDIR, NULL); |
| 6552 | if (mpt_proc_root_dir == NULL) | 6539 | if (mpt_proc_root_dir == NULL) |
| 6553 | return -ENOTDIR; | 6540 | return -ENOTDIR; |
| 6554 | 6541 | ||
| 6555 | ent = create_proc_entry("summary", S_IFREG|S_IRUGO, mpt_proc_root_dir); | 6542 | proc_create("summary", S_IRUGO, mpt_proc_root_dir, &mpt_summary_proc_fops); |
| 6556 | if (ent) | 6543 | proc_create("version", S_IRUGO, mpt_proc_root_dir, &mpt_version_proc_fops); |
| 6557 | ent->read_proc = procmpt_summary_read; | ||
| 6558 | |||
| 6559 | ent = create_proc_entry("version", S_IFREG|S_IRUGO, mpt_proc_root_dir); | ||
| 6560 | if (ent) | ||
| 6561 | ent->read_proc = procmpt_version_read; | ||
| 6562 | |||
| 6563 | return 0; | 6544 | return 0; |
| 6564 | } | 6545 | } |
| 6565 | 6546 | ||
| @@ -6579,70 +6560,46 @@ procmpt_destroy(void) | |||
| 6579 | 6560 | ||
| 6580 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 6561 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
| 6581 | /** | 6562 | /** |
| 6582 | * procmpt_summary_read - Handle read request of a summary file | ||
| 6583 | * @buf: Pointer to area to write information | ||
| 6584 | * @start: Pointer to start pointer | ||
| 6585 | * @offset: Offset to start writing | ||
| 6586 | * @request: Amount of read data requested | ||
| 6587 | * @eof: Pointer to EOF integer | ||
| 6588 | * @data: Pointer | ||
| 6589 | * | ||
| 6590 | * Handles read request from /proc/mpt/summary or /proc/mpt/iocN/summary. | 6563 | * Handles read request from /proc/mpt/summary or /proc/mpt/iocN/summary. |
| 6591 | * Returns number of characters written to process performing the read. | ||
| 6592 | */ | 6564 | */ |
| 6593 | static int | 6565 | static void seq_mpt_print_ioc_summary(MPT_ADAPTER *ioc, struct seq_file *m, int showlan); |
| 6594 | procmpt_summary_read(char *buf, char **start, off_t offset, int request, int *eof, void *data) | ||
| 6595 | { | ||
| 6596 | MPT_ADAPTER *ioc; | ||
| 6597 | char *out = buf; | ||
| 6598 | int len; | ||
| 6599 | 6566 | ||
| 6600 | if (data) { | 6567 | static int mpt_summary_proc_show(struct seq_file *m, void *v) |
| 6601 | int more = 0; | 6568 | { |
| 6602 | 6569 | MPT_ADAPTER *ioc = m->private; | |
| 6603 | ioc = data; | ||
| 6604 | mpt_print_ioc_summary(ioc, out, &more, 0, 1); | ||
| 6605 | 6570 | ||
| 6606 | out += more; | 6571 | if (ioc) { |
| 6572 | seq_mpt_print_ioc_summary(ioc, m, 1); | ||
| 6607 | } else { | 6573 | } else { |
| 6608 | list_for_each_entry(ioc, &ioc_list, list) { | 6574 | list_for_each_entry(ioc, &ioc_list, list) { |
| 6609 | int more = 0; | 6575 | seq_mpt_print_ioc_summary(ioc, m, 1); |
| 6610 | |||
| 6611 | mpt_print_ioc_summary(ioc, out, &more, 0, 1); | ||
| 6612 | |||
| 6613 | out += more; | ||
| 6614 | if ((out-buf) >= request) | ||
| 6615 | break; | ||
| 6616 | } | 6576 | } |
| 6617 | } | 6577 | } |
| 6618 | 6578 | ||
| 6619 | len = out - buf; | 6579 | return 0; |
| 6580 | } | ||
| 6620 | 6581 | ||
| 6621 | MPT_PROC_READ_RETURN(buf,start,offset,request,eof,len); | 6582 | static int mpt_summary_proc_open(struct inode *inode, struct file *file) |
| 6583 | { | ||
| 6584 | return single_open(file, mpt_summary_proc_show, PDE(inode)->data); | ||
| 6622 | } | 6585 | } |
| 6623 | 6586 | ||
| 6624 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 6587 | static const struct file_operations mpt_summary_proc_fops = { |
| 6625 | /** | 6588 | .owner = THIS_MODULE, |
| 6626 | * procmpt_version_read - Handle read request from /proc/mpt/version. | 6589 | .open = mpt_summary_proc_open, |
| 6627 | * @buf: Pointer to area to write information | 6590 | .read = seq_read, |
| 6628 | * @start: Pointer to start pointer | 6591 | .llseek = seq_lseek, |
| 6629 | * @offset: Offset to start writing | 6592 | .release = single_release, |
| 6630 | * @request: Amount of read data requested | 6593 | }; |
| 6631 | * @eof: Pointer to EOF integer | 6594 | |
| 6632 | * @data: Pointer | 6595 | static int mpt_version_proc_show(struct seq_file *m, void *v) |
| 6633 | * | ||
| 6634 | * Returns number of characters written to process performing the read. | ||
| 6635 | */ | ||
| 6636 | static int | ||
| 6637 | procmpt_version_read(char *buf, char **start, off_t offset, int request, int *eof, void *data) | ||
| 6638 | { | 6596 | { |
| 6639 | u8 cb_idx; | 6597 | u8 cb_idx; |
| 6640 | int scsi, fc, sas, lan, ctl, targ, dmp; | 6598 | int scsi, fc, sas, lan, ctl, targ, dmp; |
| 6641 | char *drvname; | 6599 | char *drvname; |
| 6642 | int len; | ||
| 6643 | 6600 | ||
| 6644 | len = sprintf(buf, "%s-%s\n", "mptlinux", MPT_LINUX_VERSION_COMMON); | 6601 | seq_printf(m, "%s-%s\n", "mptlinux", MPT_LINUX_VERSION_COMMON); |
| 6645 | len += sprintf(buf+len, " Fusion MPT base driver\n"); | 6602 | seq_printf(m, " Fusion MPT base driver\n"); |
| 6646 | 6603 | ||
| 6647 | scsi = fc = sas = lan = ctl = targ = dmp = 0; | 6604 | scsi = fc = sas = lan = ctl = targ = dmp = 0; |
| 6648 | for (cb_idx = MPT_MAX_PROTOCOL_DRIVERS-1; cb_idx; cb_idx--) { | 6605 | for (cb_idx = MPT_MAX_PROTOCOL_DRIVERS-1; cb_idx; cb_idx--) { |
| @@ -6670,98 +6627,97 @@ procmpt_version_read(char *buf, char **start, off_t offset, int request, int *eo | |||
| 6670 | } | 6627 | } |
| 6671 | 6628 | ||
| 6672 | if (drvname) | 6629 | if (drvname) |
| 6673 | len += sprintf(buf+len, " Fusion MPT %s driver\n", drvname); | 6630 | seq_printf(m, " Fusion MPT %s driver\n", drvname); |
| 6674 | } | 6631 | } |
| 6675 | } | 6632 | } |
| 6676 | 6633 | ||
| 6677 | MPT_PROC_READ_RETURN(buf,start,offset,request,eof,len); | 6634 | return 0; |
| 6678 | } | 6635 | } |
| 6679 | 6636 | ||
| 6680 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 6637 | static int mpt_version_proc_open(struct inode *inode, struct file *file) |
| 6681 | /** | 6638 | { |
| 6682 | * procmpt_iocinfo_read - Handle read request from /proc/mpt/iocN/info. | 6639 | return single_open(file, mpt_version_proc_show, NULL); |
| 6683 | * @buf: Pointer to area to write information | 6640 | } |
| 6684 | * @start: Pointer to start pointer | 6641 | |
| 6685 | * @offset: Offset to start writing | 6642 | static const struct file_operations mpt_version_proc_fops = { |
| 6686 | * @request: Amount of read data requested | 6643 | .owner = THIS_MODULE, |
| 6687 | * @eof: Pointer to EOF integer | 6644 | .open = mpt_version_proc_open, |
| 6688 | * @data: Pointer | 6645 | .read = seq_read, |
| 6689 | * | 6646 | .llseek = seq_lseek, |
| 6690 | * Returns number of characters written to process performing the read. | 6647 | .release = single_release, |
| 6691 | */ | 6648 | }; |
| 6692 | static int | 6649 | |
| 6693 | procmpt_iocinfo_read(char *buf, char **start, off_t offset, int request, int *eof, void *data) | 6650 | static int mpt_iocinfo_proc_show(struct seq_file *m, void *v) |
| 6694 | { | 6651 | { |
| 6695 | MPT_ADAPTER *ioc = data; | 6652 | MPT_ADAPTER *ioc = m->private; |
| 6696 | int len; | ||
| 6697 | char expVer[32]; | 6653 | char expVer[32]; |
| 6698 | int sz; | 6654 | int sz; |
| 6699 | int p; | 6655 | int p; |
| 6700 | 6656 | ||
| 6701 | mpt_get_fw_exp_ver(expVer, ioc); | 6657 | mpt_get_fw_exp_ver(expVer, ioc); |
| 6702 | 6658 | ||
| 6703 | len = sprintf(buf, "%s:", ioc->name); | 6659 | seq_printf(m, "%s:", ioc->name); |
| 6704 | if (ioc->facts.Flags & MPI_IOCFACTS_FLAGS_FW_DOWNLOAD_BOOT) | 6660 | if (ioc->facts.Flags & MPI_IOCFACTS_FLAGS_FW_DOWNLOAD_BOOT) |
| 6705 | len += sprintf(buf+len, " (f/w download boot flag set)"); | 6661 | seq_printf(m, " (f/w download boot flag set)"); |
| 6706 | // if (ioc->facts.IOCExceptions & MPI_IOCFACTS_EXCEPT_CONFIG_CHECKSUM_FAIL) | 6662 | // if (ioc->facts.IOCExceptions & MPI_IOCFACTS_EXCEPT_CONFIG_CHECKSUM_FAIL) |
| 6707 | // len += sprintf(buf+len, " CONFIG_CHECKSUM_FAIL!"); | 6663 | // seq_printf(m, " CONFIG_CHECKSUM_FAIL!"); |
| 6708 | 6664 | ||
| 6709 | len += sprintf(buf+len, "\n ProductID = 0x%04x (%s)\n", | 6665 | seq_printf(m, "\n ProductID = 0x%04x (%s)\n", |
| 6710 | ioc->facts.ProductID, | 6666 | ioc->facts.ProductID, |
| 6711 | ioc->prod_name); | 6667 | ioc->prod_name); |
| 6712 | len += sprintf(buf+len, " FWVersion = 0x%08x%s", ioc->facts.FWVersion.Word, expVer); | 6668 | seq_printf(m, " FWVersion = 0x%08x%s", ioc->facts.FWVersion.Word, expVer); |
| 6713 | if (ioc->facts.FWImageSize) | 6669 | if (ioc->facts.FWImageSize) |
| 6714 | len += sprintf(buf+len, " (fw_size=%d)", ioc->facts.FWImageSize); | 6670 | seq_printf(m, " (fw_size=%d)", ioc->facts.FWImageSize); |
| 6715 | len += sprintf(buf+len, "\n MsgVersion = 0x%04x\n", ioc->facts.MsgVersion); | 6671 | seq_printf(m, "\n MsgVersion = 0x%04x\n", ioc->facts.MsgVersion); |
| 6716 | len += sprintf(buf+len, " FirstWhoInit = 0x%02x\n", ioc->FirstWhoInit); | 6672 | seq_printf(m, " FirstWhoInit = 0x%02x\n", ioc->FirstWhoInit); |
| 6717 | len += sprintf(buf+len, " EventState = 0x%02x\n", ioc->facts.EventState); | 6673 | seq_printf(m, " EventState = 0x%02x\n", ioc->facts.EventState); |
| 6718 | 6674 | ||
| 6719 | len += sprintf(buf+len, " CurrentHostMfaHighAddr = 0x%08x\n", | 6675 | seq_printf(m, " CurrentHostMfaHighAddr = 0x%08x\n", |
| 6720 | ioc->facts.CurrentHostMfaHighAddr); | 6676 | ioc->facts.CurrentHostMfaHighAddr); |
| 6721 | len += sprintf(buf+len, " CurrentSenseBufferHighAddr = 0x%08x\n", | 6677 | seq_printf(m, " CurrentSenseBufferHighAddr = 0x%08x\n", |
| 6722 | ioc->facts.CurrentSenseBufferHighAddr); | 6678 | ioc->facts.CurrentSenseBufferHighAddr); |
| 6723 | 6679 | ||
| 6724 | len += sprintf(buf+len, " MaxChainDepth = 0x%02x frames\n", ioc->facts.MaxChainDepth); | 6680 | seq_printf(m, " MaxChainDepth = 0x%02x frames\n", ioc->facts.MaxChainDepth); |
| 6725 | len += sprintf(buf+len, " MinBlockSize = 0x%02x bytes\n", 4*ioc->facts.BlockSize); | 6681 | seq_printf(m, " MinBlockSize = 0x%02x bytes\n", 4*ioc->facts.BlockSize); |
| 6726 | 6682 | ||
| 6727 | len += sprintf(buf+len, " RequestFrames @ 0x%p (Dma @ 0x%p)\n", | 6683 | seq_printf(m, " RequestFrames @ 0x%p (Dma @ 0x%p)\n", |
| 6728 | (void *)ioc->req_frames, (void *)(ulong)ioc->req_frames_dma); | 6684 | (void *)ioc->req_frames, (void *)(ulong)ioc->req_frames_dma); |
| 6729 | /* | 6685 | /* |
| 6730 | * Rounding UP to nearest 4-kB boundary here... | 6686 | * Rounding UP to nearest 4-kB boundary here... |
| 6731 | */ | 6687 | */ |
| 6732 | sz = (ioc->req_sz * ioc->req_depth) + 128; | 6688 | sz = (ioc->req_sz * ioc->req_depth) + 128; |
| 6733 | sz = ((sz + 0x1000UL - 1UL) / 0x1000) * 0x1000; | 6689 | sz = ((sz + 0x1000UL - 1UL) / 0x1000) * 0x1000; |
| 6734 | len += sprintf(buf+len, " {CurReqSz=%d} x {CurReqDepth=%d} = %d bytes ^= 0x%x\n", | 6690 | seq_printf(m, " {CurReqSz=%d} x {CurReqDepth=%d} = %d bytes ^= 0x%x\n", |
| 6735 | ioc->req_sz, ioc->req_depth, ioc->req_sz*ioc->req_depth, sz); | 6691 | ioc->req_sz, ioc->req_depth, ioc->req_sz*ioc->req_depth, sz); |
| 6736 | len += sprintf(buf+len, " {MaxReqSz=%d} {MaxReqDepth=%d}\n", | 6692 | seq_printf(m, " {MaxReqSz=%d} {MaxReqDepth=%d}\n", |
| 6737 | 4*ioc->facts.RequestFrameSize, | 6693 | 4*ioc->facts.RequestFrameSize, |
| 6738 | ioc->facts.GlobalCredits); | 6694 | ioc->facts.GlobalCredits); |
| 6739 | 6695 | ||
| 6740 | len += sprintf(buf+len, " Frames @ 0x%p (Dma @ 0x%p)\n", | 6696 | seq_printf(m, " Frames @ 0x%p (Dma @ 0x%p)\n", |
| 6741 | (void *)ioc->alloc, (void *)(ulong)ioc->alloc_dma); | 6697 | (void *)ioc->alloc, (void *)(ulong)ioc->alloc_dma); |
| 6742 | sz = (ioc->reply_sz * ioc->reply_depth) + 128; | 6698 | sz = (ioc->reply_sz * ioc->reply_depth) + 128; |
| 6743 | len += sprintf(buf+len, " {CurRepSz=%d} x {CurRepDepth=%d} = %d bytes ^= 0x%x\n", | 6699 | seq_printf(m, " {CurRepSz=%d} x {CurRepDepth=%d} = %d bytes ^= 0x%x\n", |
| 6744 | ioc->reply_sz, ioc->reply_depth, ioc->reply_sz*ioc->reply_depth, sz); | 6700 | ioc->reply_sz, ioc->reply_depth, ioc->reply_sz*ioc->reply_depth, sz); |
| 6745 | len += sprintf(buf+len, " {MaxRepSz=%d} {MaxRepDepth=%d}\n", | 6701 | seq_printf(m, " {MaxRepSz=%d} {MaxRepDepth=%d}\n", |
| 6746 | ioc->facts.CurReplyFrameSize, | 6702 | ioc->facts.CurReplyFrameSize, |
| 6747 | ioc->facts.ReplyQueueDepth); | 6703 | ioc->facts.ReplyQueueDepth); |
| 6748 | 6704 | ||
| 6749 | len += sprintf(buf+len, " MaxDevices = %d\n", | 6705 | seq_printf(m, " MaxDevices = %d\n", |
| 6750 | (ioc->facts.MaxDevices==0) ? 255 : ioc->facts.MaxDevices); | 6706 | (ioc->facts.MaxDevices==0) ? 255 : ioc->facts.MaxDevices); |
| 6751 | len += sprintf(buf+len, " MaxBuses = %d\n", ioc->facts.MaxBuses); | 6707 | seq_printf(m, " MaxBuses = %d\n", ioc->facts.MaxBuses); |
| 6752 | 6708 | ||
| 6753 | /* per-port info */ | 6709 | /* per-port info */ |
| 6754 | for (p=0; p < ioc->facts.NumberOfPorts; p++) { | 6710 | for (p=0; p < ioc->facts.NumberOfPorts; p++) { |
| 6755 | len += sprintf(buf+len, " PortNumber = %d (of %d)\n", | 6711 | seq_printf(m, " PortNumber = %d (of %d)\n", |
| 6756 | p+1, | 6712 | p+1, |
| 6757 | ioc->facts.NumberOfPorts); | 6713 | ioc->facts.NumberOfPorts); |
| 6758 | if (ioc->bus_type == FC) { | 6714 | if (ioc->bus_type == FC) { |
| 6759 | if (ioc->pfacts[p].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_LAN) { | 6715 | if (ioc->pfacts[p].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_LAN) { |
| 6760 | u8 *a = (u8*)&ioc->lan_cnfg_page1.HardwareAddressLow; | 6716 | u8 *a = (u8*)&ioc->lan_cnfg_page1.HardwareAddressLow; |
| 6761 | len += sprintf(buf+len, " LanAddr = %02X:%02X:%02X:%02X:%02X:%02X\n", | 6717 | seq_printf(m, " LanAddr = %02X:%02X:%02X:%02X:%02X:%02X\n", |
| 6762 | a[5], a[4], a[3], a[2], a[1], a[0]); | 6718 | a[5], a[4], a[3], a[2], a[1], a[0]); |
| 6763 | } | 6719 | } |
| 6764 | len += sprintf(buf+len, " WWN = %08X%08X:%08X%08X\n", | 6720 | seq_printf(m, " WWN = %08X%08X:%08X%08X\n", |
| 6765 | ioc->fc_port_page0[p].WWNN.High, | 6721 | ioc->fc_port_page0[p].WWNN.High, |
| 6766 | ioc->fc_port_page0[p].WWNN.Low, | 6722 | ioc->fc_port_page0[p].WWNN.Low, |
| 6767 | ioc->fc_port_page0[p].WWPN.High, | 6723 | ioc->fc_port_page0[p].WWPN.High, |
| @@ -6769,9 +6725,21 @@ procmpt_iocinfo_read(char *buf, char **start, off_t offset, int request, int *eo | |||
| 6769 | } | 6725 | } |
| 6770 | } | 6726 | } |
| 6771 | 6727 | ||
| 6772 | MPT_PROC_READ_RETURN(buf,start,offset,request,eof,len); | 6728 | return 0; |
| 6773 | } | 6729 | } |
| 6774 | 6730 | ||
| 6731 | static int mpt_iocinfo_proc_open(struct inode *inode, struct file *file) | ||
| 6732 | { | ||
| 6733 | return single_open(file, mpt_iocinfo_proc_show, PDE(inode)->data); | ||
| 6734 | } | ||
| 6735 | |||
| 6736 | static const struct file_operations mpt_iocinfo_proc_fops = { | ||
| 6737 | .owner = THIS_MODULE, | ||
| 6738 | .open = mpt_iocinfo_proc_open, | ||
| 6739 | .read = seq_read, | ||
| 6740 | .llseek = seq_lseek, | ||
| 6741 | .release = single_release, | ||
| 6742 | }; | ||
| 6775 | #endif /* CONFIG_PROC_FS } */ | 6743 | #endif /* CONFIG_PROC_FS } */ |
| 6776 | 6744 | ||
| 6777 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 6745 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
| @@ -6837,6 +6805,39 @@ mpt_print_ioc_summary(MPT_ADAPTER *ioc, char *buffer, int *size, int len, int sh | |||
| 6837 | 6805 | ||
| 6838 | *size = y; | 6806 | *size = y; |
| 6839 | } | 6807 | } |
| 6808 | |||
| 6809 | static void seq_mpt_print_ioc_summary(MPT_ADAPTER *ioc, struct seq_file *m, int showlan) | ||
| 6810 | { | ||
| 6811 | char expVer[32]; | ||
| 6812 | |||
| 6813 | mpt_get_fw_exp_ver(expVer, ioc); | ||
| 6814 | |||
| 6815 | /* | ||
| 6816 | * Shorter summary of attached ioc's... | ||
| 6817 | */ | ||
| 6818 | seq_printf(m, "%s: %s, %s%08xh%s, Ports=%d, MaxQ=%d", | ||
| 6819 | ioc->name, | ||
| 6820 | ioc->prod_name, | ||
| 6821 | MPT_FW_REV_MAGIC_ID_STRING, /* "FwRev=" or somesuch */ | ||
| 6822 | ioc->facts.FWVersion.Word, | ||
| 6823 | expVer, | ||
| 6824 | ioc->facts.NumberOfPorts, | ||
| 6825 | ioc->req_depth); | ||
| 6826 | |||
| 6827 | if (showlan && (ioc->pfacts[0].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_LAN)) { | ||
| 6828 | u8 *a = (u8*)&ioc->lan_cnfg_page1.HardwareAddressLow; | ||
| 6829 | seq_printf(m, ", LanAddr=%02X:%02X:%02X:%02X:%02X:%02X", | ||
| 6830 | a[5], a[4], a[3], a[2], a[1], a[0]); | ||
| 6831 | } | ||
| 6832 | |||
| 6833 | seq_printf(m, ", IRQ=%d", ioc->pci_irq); | ||
| 6834 | |||
| 6835 | if (!ioc->active) | ||
| 6836 | seq_printf(m, " (disabled)"); | ||
| 6837 | |||
| 6838 | seq_putc(m, '\n'); | ||
| 6839 | } | ||
| 6840 | |||
| 6840 | /** | 6841 | /** |
| 6841 | * mpt_set_taskmgmt_in_progress_flag - set flags associated with task management | 6842 | * mpt_set_taskmgmt_in_progress_flag - set flags associated with task management |
| 6842 | * @ioc: Pointer to MPT_ADAPTER structure | 6843 | * @ioc: Pointer to MPT_ADAPTER structure |
| @@ -6922,7 +6923,6 @@ EXPORT_SYMBOL(mpt_halt_firmware); | |||
| 6922 | * mpt_SoftResetHandler - Issues a less expensive reset | 6923 | * mpt_SoftResetHandler - Issues a less expensive reset |
| 6923 | * @ioc: Pointer to MPT_ADAPTER structure | 6924 | * @ioc: Pointer to MPT_ADAPTER structure |
| 6924 | * @sleepFlag: Indicates if sleep or schedule must be called. | 6925 | * @sleepFlag: Indicates if sleep or schedule must be called. |
| 6925 | |||
| 6926 | * | 6926 | * |
| 6927 | * Returns 0 for SUCCESS or -1 if FAILED. | 6927 | * Returns 0 for SUCCESS or -1 if FAILED. |
| 6928 | * | 6928 | * |
| @@ -7067,7 +7067,6 @@ mpt_SoftResetHandler(MPT_ADAPTER *ioc, int sleepFlag) | |||
| 7067 | * mpt_Soft_Hard_ResetHandler - Try less expensive reset | 7067 | * mpt_Soft_Hard_ResetHandler - Try less expensive reset |
| 7068 | * @ioc: Pointer to MPT_ADAPTER structure | 7068 | * @ioc: Pointer to MPT_ADAPTER structure |
| 7069 | * @sleepFlag: Indicates if sleep or schedule must be called. | 7069 | * @sleepFlag: Indicates if sleep or schedule must be called. |
| 7070 | |||
| 7071 | * | 7070 | * |
| 7072 | * Returns 0 for SUCCESS or -1 if FAILED. | 7071 | * Returns 0 for SUCCESS or -1 if FAILED. |
| 7073 | * Try for softreset first, only if it fails go for expensive | 7072 | * Try for softreset first, only if it fails go for expensive |
