aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/fusion/mptbase.c
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2010-12-30 00:20:30 -0500
committerGrant Likely <grant.likely@secretlab.ca>2010-12-30 00:21:47 -0500
commitd392da5207352f09030e95d9ea335a4225667ec0 (patch)
tree7d6cd1932afcad0a5619a5c504a6d93ca318187c /drivers/message/fusion/mptbase.c
parente39d5ef678045d61812c1401f04fe8edb14d6359 (diff)
parent387c31c7e5c9805b0aef8833d1731a5fe7bdea14 (diff)
Merge v2.6.37-rc8 into powerpc/next
Diffstat (limited to 'drivers/message/fusion/mptbase.c')
-rw-r--r--drivers/message/fusion/mptbase.c251
1 files changed, 127 insertions, 124 deletions
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index b88a244a1edd..3e57b61ca446 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
110int mpt_fwfault_debug; 111int mpt_fwfault_debug;
111EXPORT_SYMBOL(mpt_fwfault_debug); 112EXPORT_SYMBOL(mpt_fwfault_debug);
112module_param_call(mpt_fwfault_debug, param_set_int, param_get_int, 113module_param(mpt_fwfault_debug, int, 0600);
113 &mpt_fwfault_debug, 0600);
114MODULE_PARM_DESC(mpt_fwfault_debug, "Enable detection of Firmware fault" 114MODULE_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
200static int mpt_host_page_alloc(MPT_ADAPTER *ioc, pIOCInit_t ioc_init); 200static int mpt_host_page_alloc(MPT_ADAPTER *ioc, pIOCInit_t ioc_init);
201 201
202#ifdef CONFIG_PROC_FS 202#ifdef CONFIG_PROC_FS
203static int procmpt_summary_read(char *buf, char **start, off_t offset, 203static const struct file_operations mpt_summary_proc_fops;
204 int request, int *eof, void *data); 204static const struct file_operations mpt_version_proc_fops;
205static int procmpt_version_read(char *buf, char **start, off_t offset, 205static const struct file_operations mpt_iocinfo_proc_fops;
206 int request, int *eof, void *data);
207static int procmpt_iocinfo_read(char *buf, char **start, off_t offset,
208 int request, int *eof, void *data);
209#endif 206#endif
210static void mpt_get_fw_exp_ver(char *buf, MPT_ADAPTER *ioc); 207static void mpt_get_fw_exp_ver(char *buf, MPT_ADAPTER *ioc);
211 208
@@ -629,6 +626,7 @@ mptbase_reply(MPT_ADAPTER *ioc, MPT_FRAME_HDR *req, MPT_FRAME_HDR *reply)
629 * mpt_register - Register protocol-specific main callback handler. 626 * mpt_register - Register protocol-specific main callback handler.
630 * @cbfunc: callback function pointer 627 * @cbfunc: callback function pointer
631 * @dclass: Protocol driver's class (%MPT_DRIVER_CLASS enum value) 628 * @dclass: Protocol driver's class (%MPT_DRIVER_CLASS enum value)
629 * @func_name: call function's name
632 * 630 *
633 * This routine is called by a protocol-specific driver (SCSI host, 631 * This routine is called by a protocol-specific driver (SCSI host,
634 * LAN, SCSI target) to register its reply callback routine. Each 632 * LAN, SCSI target) to register its reply callback routine. Each
@@ -1725,7 +1723,7 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
1725 u8 pcixcmd; 1723 u8 pcixcmd;
1726 static int mpt_ids = 0; 1724 static int mpt_ids = 0;
1727#ifdef CONFIG_PROC_FS 1725#ifdef CONFIG_PROC_FS
1728 struct proc_dir_entry *dent, *ent; 1726 struct proc_dir_entry *dent;
1729#endif 1727#endif
1730 1728
1731 ioc = kzalloc(sizeof(MPT_ADAPTER), GFP_ATOMIC); 1729 ioc = kzalloc(sizeof(MPT_ADAPTER), GFP_ATOMIC);
@@ -1980,16 +1978,8 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
1980 */ 1978 */
1981 dent = proc_mkdir(ioc->name, mpt_proc_root_dir); 1979 dent = proc_mkdir(ioc->name, mpt_proc_root_dir);
1982 if (dent) { 1980 if (dent) {
1983 ent = create_proc_entry("info", S_IFREG|S_IRUGO, dent); 1981 proc_create_data("info", S_IRUGO, dent, &mpt_iocinfo_proc_fops, ioc);
1984 if (ent) { 1982 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 } 1983 }
1994#endif 1984#endif
1995 1985
@@ -5955,8 +5945,10 @@ mpt_findImVolumes(MPT_ADAPTER *ioc)
5955 goto out; 5945 goto out;
5956 5946
5957 mem = kmalloc(iocpage2sz, GFP_KERNEL); 5947 mem = kmalloc(iocpage2sz, GFP_KERNEL);
5958 if (!mem) 5948 if (!mem) {
5949 rc = -ENOMEM;
5959 goto out; 5950 goto out;
5951 }
5960 5952
5961 memcpy(mem, (u8 *)pIoc2, iocpage2sz); 5953 memcpy(mem, (u8 *)pIoc2, iocpage2sz);
5962 ioc->raid_data.pIocPg2 = (IOCPage2_t *) mem; 5954 ioc->raid_data.pIocPg2 = (IOCPage2_t *) mem;
@@ -6546,20 +6538,12 @@ mpt_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
6546static int 6538static int
6547procmpt_create(void) 6539procmpt_create(void)
6548{ 6540{
6549 struct proc_dir_entry *ent;
6550
6551 mpt_proc_root_dir = proc_mkdir(MPT_PROCFS_MPTBASEDIR, NULL); 6541 mpt_proc_root_dir = proc_mkdir(MPT_PROCFS_MPTBASEDIR, NULL);
6552 if (mpt_proc_root_dir == NULL) 6542 if (mpt_proc_root_dir == NULL)
6553 return -ENOTDIR; 6543 return -ENOTDIR;
6554 6544
6555 ent = create_proc_entry("summary", S_IFREG|S_IRUGO, mpt_proc_root_dir); 6545 proc_create("summary", S_IRUGO, mpt_proc_root_dir, &mpt_summary_proc_fops);
6556 if (ent) 6546 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; 6547 return 0;
6564} 6548}
6565 6549
@@ -6578,71 +6562,47 @@ procmpt_destroy(void)
6578} 6562}
6579 6563
6580/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 6564/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
6581/** 6565/*
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. 6566 * Handles read request from /proc/mpt/summary or /proc/mpt/iocN/summary.
6591 * Returns number of characters written to process performing the read.
6592 */ 6567 */
6593static int 6568static void seq_mpt_print_ioc_summary(MPT_ADAPTER *ioc, struct seq_file *m, int showlan);
6594procmpt_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 6569
6600 if (data) { 6570static int mpt_summary_proc_show(struct seq_file *m, void *v)
6601 int more = 0; 6571{
6602 6572 MPT_ADAPTER *ioc = m->private;
6603 ioc = data;
6604 mpt_print_ioc_summary(ioc, out, &more, 0, 1);
6605 6573
6606 out += more; 6574 if (ioc) {
6575 seq_mpt_print_ioc_summary(ioc, m, 1);
6607 } else { 6576 } else {
6608 list_for_each_entry(ioc, &ioc_list, list) { 6577 list_for_each_entry(ioc, &ioc_list, list) {
6609 int more = 0; 6578 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 } 6579 }
6617 } 6580 }
6618 6581
6619 len = out - buf; 6582 return 0;
6583}
6620 6584
6621 MPT_PROC_READ_RETURN(buf,start,offset,request,eof,len); 6585static int mpt_summary_proc_open(struct inode *inode, struct file *file)
6586{
6587 return single_open(file, mpt_summary_proc_show, PDE(inode)->data);
6622} 6588}
6623 6589
6624/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 6590static const struct file_operations mpt_summary_proc_fops = {
6625/** 6591 .owner = THIS_MODULE,
6626 * procmpt_version_read - Handle read request from /proc/mpt/version. 6592 .open = mpt_summary_proc_open,
6627 * @buf: Pointer to area to write information 6593 .read = seq_read,
6628 * @start: Pointer to start pointer 6594 .llseek = seq_lseek,
6629 * @offset: Offset to start writing 6595 .release = single_release,
6630 * @request: Amount of read data requested 6596};
6631 * @eof: Pointer to EOF integer 6597
6632 * @data: Pointer 6598static int mpt_version_proc_show(struct seq_file *m, void *v)
6633 *
6634 * Returns number of characters written to process performing the read.
6635 */
6636static int
6637procmpt_version_read(char *buf, char **start, off_t offset, int request, int *eof, void *data)
6638{ 6599{
6639 u8 cb_idx; 6600 u8 cb_idx;
6640 int scsi, fc, sas, lan, ctl, targ, dmp; 6601 int scsi, fc, sas, lan, ctl, targ, dmp;
6641 char *drvname; 6602 char *drvname;
6642 int len;
6643 6603
6644 len = sprintf(buf, "%s-%s\n", "mptlinux", MPT_LINUX_VERSION_COMMON); 6604 seq_printf(m, "%s-%s\n", "mptlinux", MPT_LINUX_VERSION_COMMON);
6645 len += sprintf(buf+len, " Fusion MPT base driver\n"); 6605 seq_printf(m, " Fusion MPT base driver\n");
6646 6606
6647 scsi = fc = sas = lan = ctl = targ = dmp = 0; 6607 scsi = fc = sas = lan = ctl = targ = dmp = 0;
6648 for (cb_idx = MPT_MAX_PROTOCOL_DRIVERS-1; cb_idx; cb_idx--) { 6608 for (cb_idx = MPT_MAX_PROTOCOL_DRIVERS-1; cb_idx; cb_idx--) {
@@ -6670,98 +6630,97 @@ procmpt_version_read(char *buf, char **start, off_t offset, int request, int *eo
6670 } 6630 }
6671 6631
6672 if (drvname) 6632 if (drvname)
6673 len += sprintf(buf+len, " Fusion MPT %s driver\n", drvname); 6633 seq_printf(m, " Fusion MPT %s driver\n", drvname);
6674 } 6634 }
6675 } 6635 }
6676 6636
6677 MPT_PROC_READ_RETURN(buf,start,offset,request,eof,len); 6637 return 0;
6678} 6638}
6679 6639
6680/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 6640static int mpt_version_proc_open(struct inode *inode, struct file *file)
6681/**
6682 * procmpt_iocinfo_read - Handle read request from /proc/mpt/iocN/info.
6683 * @buf: Pointer to area to write information
6684 * @start: Pointer to start pointer
6685 * @offset: Offset to start writing
6686 * @request: Amount of read data requested
6687 * @eof: Pointer to EOF integer
6688 * @data: Pointer
6689 *
6690 * Returns number of characters written to process performing the read.
6691 */
6692static int
6693procmpt_iocinfo_read(char *buf, char **start, off_t offset, int request, int *eof, void *data)
6694{ 6641{
6695 MPT_ADAPTER *ioc = data; 6642 return single_open(file, mpt_version_proc_show, NULL);
6696 int len; 6643}
6644
6645static const struct file_operations mpt_version_proc_fops = {
6646 .owner = THIS_MODULE,
6647 .open = mpt_version_proc_open,
6648 .read = seq_read,
6649 .llseek = seq_lseek,
6650 .release = single_release,
6651};
6652
6653static int mpt_iocinfo_proc_show(struct seq_file *m, void *v)
6654{
6655 MPT_ADAPTER *ioc = m->private;
6697 char expVer[32]; 6656 char expVer[32];
6698 int sz; 6657 int sz;
6699 int p; 6658 int p;
6700 6659
6701 mpt_get_fw_exp_ver(expVer, ioc); 6660 mpt_get_fw_exp_ver(expVer, ioc);
6702 6661
6703 len = sprintf(buf, "%s:", ioc->name); 6662 seq_printf(m, "%s:", ioc->name);
6704 if (ioc->facts.Flags & MPI_IOCFACTS_FLAGS_FW_DOWNLOAD_BOOT) 6663 if (ioc->facts.Flags & MPI_IOCFACTS_FLAGS_FW_DOWNLOAD_BOOT)
6705 len += sprintf(buf+len, " (f/w download boot flag set)"); 6664 seq_printf(m, " (f/w download boot flag set)");
6706// if (ioc->facts.IOCExceptions & MPI_IOCFACTS_EXCEPT_CONFIG_CHECKSUM_FAIL) 6665// if (ioc->facts.IOCExceptions & MPI_IOCFACTS_EXCEPT_CONFIG_CHECKSUM_FAIL)
6707// len += sprintf(buf+len, " CONFIG_CHECKSUM_FAIL!"); 6666// seq_printf(m, " CONFIG_CHECKSUM_FAIL!");
6708 6667
6709 len += sprintf(buf+len, "\n ProductID = 0x%04x (%s)\n", 6668 seq_printf(m, "\n ProductID = 0x%04x (%s)\n",
6710 ioc->facts.ProductID, 6669 ioc->facts.ProductID,
6711 ioc->prod_name); 6670 ioc->prod_name);
6712 len += sprintf(buf+len, " FWVersion = 0x%08x%s", ioc->facts.FWVersion.Word, expVer); 6671 seq_printf(m, " FWVersion = 0x%08x%s", ioc->facts.FWVersion.Word, expVer);
6713 if (ioc->facts.FWImageSize) 6672 if (ioc->facts.FWImageSize)
6714 len += sprintf(buf+len, " (fw_size=%d)", ioc->facts.FWImageSize); 6673 seq_printf(m, " (fw_size=%d)", ioc->facts.FWImageSize);
6715 len += sprintf(buf+len, "\n MsgVersion = 0x%04x\n", ioc->facts.MsgVersion); 6674 seq_printf(m, "\n MsgVersion = 0x%04x\n", ioc->facts.MsgVersion);
6716 len += sprintf(buf+len, " FirstWhoInit = 0x%02x\n", ioc->FirstWhoInit); 6675 seq_printf(m, " FirstWhoInit = 0x%02x\n", ioc->FirstWhoInit);
6717 len += sprintf(buf+len, " EventState = 0x%02x\n", ioc->facts.EventState); 6676 seq_printf(m, " EventState = 0x%02x\n", ioc->facts.EventState);
6718 6677
6719 len += sprintf(buf+len, " CurrentHostMfaHighAddr = 0x%08x\n", 6678 seq_printf(m, " CurrentHostMfaHighAddr = 0x%08x\n",
6720 ioc->facts.CurrentHostMfaHighAddr); 6679 ioc->facts.CurrentHostMfaHighAddr);
6721 len += sprintf(buf+len, " CurrentSenseBufferHighAddr = 0x%08x\n", 6680 seq_printf(m, " CurrentSenseBufferHighAddr = 0x%08x\n",
6722 ioc->facts.CurrentSenseBufferHighAddr); 6681 ioc->facts.CurrentSenseBufferHighAddr);
6723 6682
6724 len += sprintf(buf+len, " MaxChainDepth = 0x%02x frames\n", ioc->facts.MaxChainDepth); 6683 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); 6684 seq_printf(m, " MinBlockSize = 0x%02x bytes\n", 4*ioc->facts.BlockSize);
6726 6685
6727 len += sprintf(buf+len, " RequestFrames @ 0x%p (Dma @ 0x%p)\n", 6686 seq_printf(m, " RequestFrames @ 0x%p (Dma @ 0x%p)\n",
6728 (void *)ioc->req_frames, (void *)(ulong)ioc->req_frames_dma); 6687 (void *)ioc->req_frames, (void *)(ulong)ioc->req_frames_dma);
6729 /* 6688 /*
6730 * Rounding UP to nearest 4-kB boundary here... 6689 * Rounding UP to nearest 4-kB boundary here...
6731 */ 6690 */
6732 sz = (ioc->req_sz * ioc->req_depth) + 128; 6691 sz = (ioc->req_sz * ioc->req_depth) + 128;
6733 sz = ((sz + 0x1000UL - 1UL) / 0x1000) * 0x1000; 6692 sz = ((sz + 0x1000UL - 1UL) / 0x1000) * 0x1000;
6734 len += sprintf(buf+len, " {CurReqSz=%d} x {CurReqDepth=%d} = %d bytes ^= 0x%x\n", 6693 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); 6694 ioc->req_sz, ioc->req_depth, ioc->req_sz*ioc->req_depth, sz);
6736 len += sprintf(buf+len, " {MaxReqSz=%d} {MaxReqDepth=%d}\n", 6695 seq_printf(m, " {MaxReqSz=%d} {MaxReqDepth=%d}\n",
6737 4*ioc->facts.RequestFrameSize, 6696 4*ioc->facts.RequestFrameSize,
6738 ioc->facts.GlobalCredits); 6697 ioc->facts.GlobalCredits);
6739 6698
6740 len += sprintf(buf+len, " Frames @ 0x%p (Dma @ 0x%p)\n", 6699 seq_printf(m, " Frames @ 0x%p (Dma @ 0x%p)\n",
6741 (void *)ioc->alloc, (void *)(ulong)ioc->alloc_dma); 6700 (void *)ioc->alloc, (void *)(ulong)ioc->alloc_dma);
6742 sz = (ioc->reply_sz * ioc->reply_depth) + 128; 6701 sz = (ioc->reply_sz * ioc->reply_depth) + 128;
6743 len += sprintf(buf+len, " {CurRepSz=%d} x {CurRepDepth=%d} = %d bytes ^= 0x%x\n", 6702 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); 6703 ioc->reply_sz, ioc->reply_depth, ioc->reply_sz*ioc->reply_depth, sz);
6745 len += sprintf(buf+len, " {MaxRepSz=%d} {MaxRepDepth=%d}\n", 6704 seq_printf(m, " {MaxRepSz=%d} {MaxRepDepth=%d}\n",
6746 ioc->facts.CurReplyFrameSize, 6705 ioc->facts.CurReplyFrameSize,
6747 ioc->facts.ReplyQueueDepth); 6706 ioc->facts.ReplyQueueDepth);
6748 6707
6749 len += sprintf(buf+len, " MaxDevices = %d\n", 6708 seq_printf(m, " MaxDevices = %d\n",
6750 (ioc->facts.MaxDevices==0) ? 255 : ioc->facts.MaxDevices); 6709 (ioc->facts.MaxDevices==0) ? 255 : ioc->facts.MaxDevices);
6751 len += sprintf(buf+len, " MaxBuses = %d\n", ioc->facts.MaxBuses); 6710 seq_printf(m, " MaxBuses = %d\n", ioc->facts.MaxBuses);
6752 6711
6753 /* per-port info */ 6712 /* per-port info */
6754 for (p=0; p < ioc->facts.NumberOfPorts; p++) { 6713 for (p=0; p < ioc->facts.NumberOfPorts; p++) {
6755 len += sprintf(buf+len, " PortNumber = %d (of %d)\n", 6714 seq_printf(m, " PortNumber = %d (of %d)\n",
6756 p+1, 6715 p+1,
6757 ioc->facts.NumberOfPorts); 6716 ioc->facts.NumberOfPorts);
6758 if (ioc->bus_type == FC) { 6717 if (ioc->bus_type == FC) {
6759 if (ioc->pfacts[p].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_LAN) { 6718 if (ioc->pfacts[p].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_LAN) {
6760 u8 *a = (u8*)&ioc->lan_cnfg_page1.HardwareAddressLow; 6719 u8 *a = (u8*)&ioc->lan_cnfg_page1.HardwareAddressLow;
6761 len += sprintf(buf+len, " LanAddr = %02X:%02X:%02X:%02X:%02X:%02X\n", 6720 seq_printf(m, " LanAddr = %02X:%02X:%02X:%02X:%02X:%02X\n",
6762 a[5], a[4], a[3], a[2], a[1], a[0]); 6721 a[5], a[4], a[3], a[2], a[1], a[0]);
6763 } 6722 }
6764 len += sprintf(buf+len, " WWN = %08X%08X:%08X%08X\n", 6723 seq_printf(m, " WWN = %08X%08X:%08X%08X\n",
6765 ioc->fc_port_page0[p].WWNN.High, 6724 ioc->fc_port_page0[p].WWNN.High,
6766 ioc->fc_port_page0[p].WWNN.Low, 6725 ioc->fc_port_page0[p].WWNN.Low,
6767 ioc->fc_port_page0[p].WWPN.High, 6726 ioc->fc_port_page0[p].WWPN.High,
@@ -6769,9 +6728,21 @@ procmpt_iocinfo_read(char *buf, char **start, off_t offset, int request, int *eo
6769 } 6728 }
6770 } 6729 }
6771 6730
6772 MPT_PROC_READ_RETURN(buf,start,offset,request,eof,len); 6731 return 0;
6732}
6733
6734static int mpt_iocinfo_proc_open(struct inode *inode, struct file *file)
6735{
6736 return single_open(file, mpt_iocinfo_proc_show, PDE(inode)->data);
6773} 6737}
6774 6738
6739static const struct file_operations mpt_iocinfo_proc_fops = {
6740 .owner = THIS_MODULE,
6741 .open = mpt_iocinfo_proc_open,
6742 .read = seq_read,
6743 .llseek = seq_lseek,
6744 .release = single_release,
6745};
6775#endif /* CONFIG_PROC_FS } */ 6746#endif /* CONFIG_PROC_FS } */
6776 6747
6777/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 6748/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -6837,6 +6808,39 @@ mpt_print_ioc_summary(MPT_ADAPTER *ioc, char *buffer, int *size, int len, int sh
6837 6808
6838 *size = y; 6809 *size = y;
6839} 6810}
6811
6812static void seq_mpt_print_ioc_summary(MPT_ADAPTER *ioc, struct seq_file *m, int showlan)
6813{
6814 char expVer[32];
6815
6816 mpt_get_fw_exp_ver(expVer, ioc);
6817
6818 /*
6819 * Shorter summary of attached ioc's...
6820 */
6821 seq_printf(m, "%s: %s, %s%08xh%s, Ports=%d, MaxQ=%d",
6822 ioc->name,
6823 ioc->prod_name,
6824 MPT_FW_REV_MAGIC_ID_STRING, /* "FwRev=" or somesuch */
6825 ioc->facts.FWVersion.Word,
6826 expVer,
6827 ioc->facts.NumberOfPorts,
6828 ioc->req_depth);
6829
6830 if (showlan && (ioc->pfacts[0].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_LAN)) {
6831 u8 *a = (u8*)&ioc->lan_cnfg_page1.HardwareAddressLow;
6832 seq_printf(m, ", LanAddr=%02X:%02X:%02X:%02X:%02X:%02X",
6833 a[5], a[4], a[3], a[2], a[1], a[0]);
6834 }
6835
6836 seq_printf(m, ", IRQ=%d", ioc->pci_irq);
6837
6838 if (!ioc->active)
6839 seq_printf(m, " (disabled)");
6840
6841 seq_putc(m, '\n');
6842}
6843
6840/** 6844/**
6841 * mpt_set_taskmgmt_in_progress_flag - set flags associated with task management 6845 * mpt_set_taskmgmt_in_progress_flag - set flags associated with task management
6842 * @ioc: Pointer to MPT_ADAPTER structure 6846 * @ioc: Pointer to MPT_ADAPTER structure
@@ -6922,7 +6926,6 @@ EXPORT_SYMBOL(mpt_halt_firmware);
6922 * mpt_SoftResetHandler - Issues a less expensive reset 6926 * mpt_SoftResetHandler - Issues a less expensive reset
6923 * @ioc: Pointer to MPT_ADAPTER structure 6927 * @ioc: Pointer to MPT_ADAPTER structure
6924 * @sleepFlag: Indicates if sleep or schedule must be called. 6928 * @sleepFlag: Indicates if sleep or schedule must be called.
6925
6926 * 6929 *
6927 * Returns 0 for SUCCESS or -1 if FAILED. 6930 * Returns 0 for SUCCESS or -1 if FAILED.
6928 * 6931 *
@@ -7067,7 +7070,6 @@ mpt_SoftResetHandler(MPT_ADAPTER *ioc, int sleepFlag)
7067 * mpt_Soft_Hard_ResetHandler - Try less expensive reset 7070 * mpt_Soft_Hard_ResetHandler - Try less expensive reset
7068 * @ioc: Pointer to MPT_ADAPTER structure 7071 * @ioc: Pointer to MPT_ADAPTER structure
7069 * @sleepFlag: Indicates if sleep or schedule must be called. 7072 * @sleepFlag: Indicates if sleep or schedule must be called.
7070
7071 * 7073 *
7072 * Returns 0 for SUCCESS or -1 if FAILED. 7074 * Returns 0 for SUCCESS or -1 if FAILED.
7073 * Try for softreset first, only if it fails go for expensive 7075 * Try for softreset first, only if it fails go for expensive
@@ -8004,6 +8006,7 @@ mpt_spi_log_info(MPT_ADAPTER *ioc, u32 log_info)
8004 * mpt_sas_log_info - Log information returned from SAS IOC. 8006 * mpt_sas_log_info - Log information returned from SAS IOC.
8005 * @ioc: Pointer to MPT_ADAPTER structure 8007 * @ioc: Pointer to MPT_ADAPTER structure
8006 * @log_info: U32 LogInfo reply word from the IOC 8008 * @log_info: U32 LogInfo reply word from the IOC
8009 * @cb_idx: callback function's handle
8007 * 8010 *
8008 * Refer to lsi/mpi_log_sas.h. 8011 * Refer to lsi/mpi_log_sas.h.
8009 **/ 8012 **/
@@ -8050,7 +8053,7 @@ union loginfo_type {
8050 code_desc = ir_code_str[sas_loginfo.dw.code]; 8053 code_desc = ir_code_str[sas_loginfo.dw.code];
8051 if (sas_loginfo.dw.subcode >= 8054 if (sas_loginfo.dw.subcode >=
8052 ARRAY_SIZE(raid_sub_code_str)) 8055 ARRAY_SIZE(raid_sub_code_str))
8053 break; 8056 break;
8054 if (sas_loginfo.dw.code == 0) 8057 if (sas_loginfo.dw.code == 0)
8055 sub_code_desc = 8058 sub_code_desc =
8056 raid_sub_code_str[sas_loginfo.dw.subcode]; 8059 raid_sub_code_str[sas_loginfo.dw.subcode];