From c3d833685583f943fb0b5511a9e4602becb1668b Mon Sep 17 00:00:00 2001 From: Thomas Bogendoerfer Date: Tue, 16 May 2006 06:38:29 +0200 Subject: [SCSI] Blacklist entry for HP dat changer after upgrading our SUN E250 from 2.4 to 2.6 I'm seeing following error when the HP DDS4 DAT changer gets probed: scsi: host 1 channel 0 id 5 lun16777216 has a LUN larger than allowed by the host adapter The device is connected to a symbios 875 host. I've talked to Willy about the problem, and he asked me to try to blacklist the device for reportlun. I did that with the patch below and it solved the problem. It now gets properly detected: target1:0:5: FAST-20 WIDE SCSI 40.0 MB/s ST (50 ns, offset 16) Vendor: HP Model: C5713A Rev: H307 Type: Sequential-Access ANSI SCSI revision: 03 target1:0:5: Beginning Domain Validation target1:0:5: FAST-20 SCSI 20.0 MB/s ST (50 ns, offset 16) target1:0:5: FAST-20 WIDE SCSI 40.0 MB/s ST (50 ns, offset 16) target1:0:5: Domain Validation skipping write tests target1:0:5: Ending Domain Validation Vendor: HP Model: C5713A Rev: H307 Type: Medium Changer ANSI SCSI revision: 03 Signed-off-by: tsbogend@alpha.franken.de Signed-off-by: James Bottomley --- drivers/scsi/scsi_devinfo.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers') diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c index 941c1e15c899..62f8cb7b3d2b 100644 --- a/drivers/scsi/scsi_devinfo.c +++ b/drivers/scsi/scsi_devinfo.c @@ -165,6 +165,7 @@ static struct { {"HP", "HSV100", NULL, BLIST_REPORTLUN2 | BLIST_NOSTARTONADD}, {"HP", "C1557A", NULL, BLIST_FORCELUN}, {"HP", "C3323-300", "4269", BLIST_NOTQ}, + {"HP", "C5713A", NULL, BLIST_NOREPORTLUN}, {"IBM", "AuSaV1S2", NULL, BLIST_FORCELUN}, {"IBM", "ProFibre 4000R", "*", BLIST_SPARSELUN | BLIST_LARGELUN}, {"IBM", "2105", NULL, BLIST_RETRY_HWERROR}, -- cgit v1.2.2 From 4ff42a669a9ad3eb8274da31c7baabd968c2d365 Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Wed, 17 May 2006 18:06:52 -0500 Subject: [SCSI] mptspi: reset handler shouldn't be called for other bus protocols All registered reset callback handlers are called during reset processing. The mptspi modules has its own reset callback handler, just recently added for issuing domain validation after host reset. If either the mptsas or mptfc driver are loaded, this callback could be called. Thus resulting in domain validation being issued for sas or fibre end devices. Fix this by having mptbase.c check the bus type against the driver type and only call the reset handler if they match (or if it's a non-bus specific reset handler). Signed-off-by: James Bottomley --- drivers/message/fusion/mptbase.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'drivers') diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index 9080853fe283..a30084076ac8 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c @@ -1605,6 +1605,21 @@ mpt_resume(struct pci_dev *pdev) } #endif +static int +mpt_signal_reset(int index, MPT_ADAPTER *ioc, int reset_phase) +{ + if ((MptDriverClass[index] == MPTSPI_DRIVER && + ioc->bus_type != SPI) || + (MptDriverClass[index] == MPTFC_DRIVER && + ioc->bus_type != FC) || + (MptDriverClass[index] == MPTSAS_DRIVER && + ioc->bus_type != SAS)) + /* make sure we only call the relevant reset handler + * for the bus */ + return 0; + return (MptResetHandlers[index])(ioc, reset_phase); +} + /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* * mpt_do_ioc_recovery - Initialize or recover MPT adapter. @@ -1885,14 +1900,14 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) if ((ret == 0) && MptResetHandlers[ii]) { dprintk((MYIOC_s_INFO_FMT "Calling IOC post_reset handler #%d\n", ioc->name, ii)); - rc += (*(MptResetHandlers[ii]))(ioc, MPT_IOC_POST_RESET); + rc += mpt_signal_reset(ii, ioc, MPT_IOC_POST_RESET); handlers++; } if (alt_ioc_ready && MptResetHandlers[ii]) { drsprintk((MYIOC_s_INFO_FMT "Calling alt-%s post_reset handler #%d\n", ioc->name, ioc->alt_ioc->name, ii)); - rc += (*(MptResetHandlers[ii]))(ioc->alt_ioc, MPT_IOC_POST_RESET); + rc += mpt_signal_reset(ii, ioc->alt_ioc, MPT_IOC_POST_RESET); handlers++; } } @@ -3267,11 +3282,11 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag) if (MptResetHandlers[ii]) { dprintk((MYIOC_s_INFO_FMT "Calling IOC pre_reset handler #%d\n", ioc->name, ii)); - r += (*(MptResetHandlers[ii]))(ioc, MPT_IOC_PRE_RESET); + r += mpt_signal_reset(ii, ioc, MPT_IOC_PRE_RESET); if (ioc->alt_ioc) { dprintk((MYIOC_s_INFO_FMT "Calling alt-%s pre_reset handler #%d\n", ioc->name, ioc->alt_ioc->name, ii)); - r += (*(MptResetHandlers[ii]))(ioc->alt_ioc, MPT_IOC_PRE_RESET); + r += mpt_signal_reset(ii, ioc->alt_ioc, MPT_IOC_PRE_RESET); } } } @@ -5706,11 +5721,11 @@ mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag) if (MptResetHandlers[ii]) { dtmprintk((MYIOC_s_INFO_FMT "Calling IOC reset_setup handler #%d\n", ioc->name, ii)); - r += (*(MptResetHandlers[ii]))(ioc, MPT_IOC_SETUP_RESET); + r += mpt_signal_reset(ii, ioc, MPT_IOC_SETUP_RESET); if (ioc->alt_ioc) { dtmprintk((MYIOC_s_INFO_FMT "Calling alt-%s setup reset handler #%d\n", ioc->name, ioc->alt_ioc->name, ii)); - r += (*(MptResetHandlers[ii]))(ioc->alt_ioc, MPT_IOC_SETUP_RESET); + r += mpt_signal_reset(ii, ioc->alt_ioc, MPT_IOC_SETUP_RESET); } } } -- cgit v1.2.2 From 78a904b65420e02bf964af6a83c1fd7a85e0b59d Mon Sep 17 00:00:00 2001 From: "Randy.Dunlap" Date: Fri, 19 May 2006 10:11:02 -0700 Subject: [SCSI] ppa: fix for machines with highmem ppa cannot handle highmem pages, and like imm, which already has this patch, the device is slow, so performance is not a big issue, so just force pages to be in low memory (hence mapped). Signed-off-by: Randy Dunlap Signed-off-by: James Bottomley --- drivers/scsi/ppa.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers') diff --git a/drivers/scsi/ppa.c b/drivers/scsi/ppa.c index fee843fab1c7..108910f512e4 100644 --- a/drivers/scsi/ppa.c +++ b/drivers/scsi/ppa.c @@ -982,6 +982,12 @@ static int device_check(ppa_struct *dev) return -ENODEV; } +static int ppa_adjust_queue(struct scsi_device *device) +{ + blk_queue_bounce_limit(device->request_queue, BLK_BOUNCE_HIGH); + return 0; +} + static struct scsi_host_template ppa_template = { .module = THIS_MODULE, .proc_name = "ppa", @@ -997,6 +1003,7 @@ static struct scsi_host_template ppa_template = { .cmd_per_lun = 1, .use_clustering = ENABLE_CLUSTERING, .can_queue = 1, + .slave_alloc = ppa_adjust_queue, }; /*************************************************************************** -- cgit v1.2.2 From 6d99a3f372181160a56d7b1ee3259dbe03663f0d Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Fri, 19 May 2006 10:49:37 -0500 Subject: [SCSI] scsi_transport_sas; fix user_scan the user_scan() callback currently has the potential to identify the wrong device in the presence of expanders. This is because it finds the first device with a matching target_id, which might be an expander. Fix this by making it look specifically for end devices. Signed-off-by: James Bottomley --- drivers/scsi/scsi_transport_sas.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c index 8b6d65e21bae..8126c395de16 100644 --- a/drivers/scsi/scsi_transport_sas.c +++ b/drivers/scsi/scsi_transport_sas.c @@ -955,7 +955,8 @@ static int sas_user_scan(struct Scsi_Host *shost, uint channel, list_for_each_entry(rphy, &sas_host->rphy_list, list) { struct sas_phy *parent = dev_to_phy(rphy->dev.parent); - if (rphy->scsi_target_id == -1) + if (rphy->identify.device_type != SAS_END_DEVICE || + rphy->scsi_target_id == -1) continue; if ((channel == SCAN_WILD_CARD || channel == parent->port_identifier) && -- cgit v1.2.2 From 9f434d4f84a235f6b61aec6e691d6b07bc46fc24 Mon Sep 17 00:00:00 2001 From: Eric Moore Date: Wed, 17 May 2006 18:19:43 -0600 Subject: [SCSI] scsi_transport_sas: make write attrs writeable A couple write attributes in sas transport layer have a small bug that prevents them from being written to. Those attributes are the link_reset and write_reset. This is due the store field being set to NULL. Signed-off-by: Eric Moore Signed-off-by: James Bottomley --- drivers/scsi/scsi_transport_sas.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers') diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c index 8126c395de16..f3b16066387c 100644 --- a/drivers/scsi/scsi_transport_sas.c +++ b/drivers/scsi/scsi_transport_sas.c @@ -978,7 +978,6 @@ static int sas_user_scan(struct Scsi_Host *shost, uint channel, #define SETUP_TEMPLATE(attrb, field, perm, test) \ i->private_##attrb[count] = class_device_attr_##field; \ i->private_##attrb[count].attr.mode = perm; \ - i->private_##attrb[count].store = NULL; \ i->attrb[count] = &i->private_##attrb[count]; \ if (test) \ count++ -- cgit v1.2.2 From 283a12c53b9abeed89491da4a1eda98f5764947b Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Tue, 28 Mar 2006 09:38:45 +0200 Subject: [AGPGART] Enable SIS AGP driver on x86-64 for EM64T systems Enable SIS AGP driver on x86-64 for EM64T systems Untested so far Signed-off-by: Andi Kleen Signed-off-by: Dave Jones --- drivers/char/agp/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/char/agp/Kconfig b/drivers/char/agp/Kconfig index 0b9cf9c59a21..7c88c060a9e6 100644 --- a/drivers/char/agp/Kconfig +++ b/drivers/char/agp/Kconfig @@ -86,7 +86,7 @@ config AGP_NVIDIA config AGP_SIS tristate "SiS chipset support" - depends on AGP && X86_32 + depends on AGP help This option gives you AGP support for the GLX component of X on Silicon Integrated Systems [SiS] chipsets. -- cgit v1.2.2 From ca2797ffaabc1f73cf8a73a30f709f0c1a6bef34 Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Sun, 21 May 2006 17:11:42 -0400 Subject: [AGPGART] Fix Nforce3 suspend on amd64. kernel.org bugzilla #6206 Based on patch from Serge Belyshev Signed-off-by: Dave Jones --- drivers/char/agp/amd64-agp.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers') diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c index 36517d4d1ad9..ac3c33a2e37d 100644 --- a/drivers/char/agp/amd64-agp.c +++ b/drivers/char/agp/amd64-agp.c @@ -617,6 +617,9 @@ static int agp_amd64_resume(struct pci_dev *pdev) pci_set_power_state(pdev, PCI_D0); pci_restore_state(pdev); + if (pdev->vendor == PCI_VENDOR_ID_NVIDIA) + nforce3_agp_init(pdev); + return amd_8151_configure(); } -- cgit v1.2.2 From 7dd1d9b85cfb63eebf48fa13d3c5d25a3deb3a25 Mon Sep 17 00:00:00 2001 From: Magnus Kessler Date: Mon, 22 May 2006 10:53:10 +0100 Subject: [AGPGART] VIA PT880 Ultra support. This patch enables agpgart on a Via "PT880 Ultra" based motherboard (Asus P4V800D-X). The PCI ID of the PT880 Ultra is 0x0308 instead of 0x0258 of the PT880. The patched via-agp passes testgart. Signed-off-by: Magnus Kessler Signed-off-by: Dave Jones --- drivers/char/agp/via-agp.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers') diff --git a/drivers/char/agp/via-agp.c b/drivers/char/agp/via-agp.c index 97b0a890ba7f..b8ec25d17478 100644 --- a/drivers/char/agp/via-agp.c +++ b/drivers/char/agp/via-agp.c @@ -345,6 +345,12 @@ static struct agp_device_ids via_agp_device_ids[] __devinitdata = .chipset_name = "PT880", }, + /* PT880 Ultra */ + { + .device_id = PCI_DEVICE_ID_VIA_PT880ULTRA, + .chipset_name = "PT880 Ultra", + }, + /* PT890 */ { .device_id = PCI_DEVICE_ID_VIA_8783_0, @@ -511,6 +517,7 @@ static struct pci_device_id agp_via_pci_table[] = { ID(PCI_DEVICE_ID_VIA_8763_0), ID(PCI_DEVICE_ID_VIA_8378_0), ID(PCI_DEVICE_ID_VIA_PT880), + ID(PCI_DEVICE_ID_VIA_PT880ULTRA), ID(PCI_DEVICE_ID_VIA_8783_0), ID(PCI_DEVICE_ID_VIA_PX8X0_0), ID(PCI_DEVICE_ID_VIA_3269_0), -- cgit v1.2.2 From ab28b171eabc0a414e0404844453c11af3caed10 Mon Sep 17 00:00:00 2001 From: "Michael S. Tsirkin" Date: Wed, 24 May 2006 18:27:07 +0300 Subject: IB/mthca: Fix posting lists of 256 receive requests to SRQ for Tavor If we post a list of length exactly a multiple of 256, nreq in doorbell gets set to 256 which is wrong: it should be encoded by 0. This is because we only zero it out on the next WR, which may not be there. The solution is to ring the doorbell after posting a WQE, not before posting the next one. This is the same bug that we just fixed for QPs with non-shared RQ. Signed-off-by: Michael S. Tsirkin Signed-off-by: Roland Dreier --- drivers/infiniband/hw/mthca/mthca_srq.c | 41 +++++++++++++++++---------------- 1 file changed, 21 insertions(+), 20 deletions(-) (limited to 'drivers') diff --git a/drivers/infiniband/hw/mthca/mthca_srq.c b/drivers/infiniband/hw/mthca/mthca_srq.c index 1ea433291fa7..b292fefa3b41 100644 --- a/drivers/infiniband/hw/mthca/mthca_srq.c +++ b/drivers/infiniband/hw/mthca/mthca_srq.c @@ -490,26 +490,7 @@ int mthca_tavor_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr, first_ind = srq->first_free; - for (nreq = 0; wr; ++nreq, wr = wr->next) { - if (unlikely(nreq == MTHCA_TAVOR_MAX_WQES_PER_RECV_DB)) { - nreq = 0; - - doorbell[0] = cpu_to_be32(first_ind << srq->wqe_shift); - doorbell[1] = cpu_to_be32(srq->srqn << 8); - - /* - * Make sure that descriptors are written - * before doorbell is rung. - */ - wmb(); - - mthca_write64(doorbell, - dev->kar + MTHCA_RECEIVE_DOORBELL, - MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock)); - - first_ind = srq->first_free; - } - + for (nreq = 0; wr; wr = wr->next) { ind = srq->first_free; if (ind < 0) { @@ -569,6 +550,26 @@ int mthca_tavor_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr, srq->wrid[ind] = wr->wr_id; srq->first_free = next_ind; + + ++nreq; + if (unlikely(nreq == MTHCA_TAVOR_MAX_WQES_PER_RECV_DB)) { + nreq = 0; + + doorbell[0] = cpu_to_be32(first_ind << srq->wqe_shift); + doorbell[1] = cpu_to_be32(srq->srqn << 8); + + /* + * Make sure that descriptors are written + * before doorbell is rung. + */ + wmb(); + + mthca_write64(doorbell, + dev->kar + MTHCA_RECEIVE_DOORBELL, + MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock)); + + first_ind = srq->first_free; + } } if (likely(nreq)) { -- cgit v1.2.2 From 56bc348ce8a709a70cd80857ffc09749f871d7a8 Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Thu, 25 May 2006 16:17:53 -0700 Subject: [IRDA]: *_DONGLE should depend on IRTTY_SIR If a SIR dongle is built in the kernel while IRTTY_SIR is built as a module, kernel compilation will fail. Thus, the SIR dongle config should depend on the IRTTY_SIR. Closes kernel bug# 6512 (http://bugzilla.kernel.org/show_bug.cgi?id=6512) Signed-off-by: Samuel Ortiz Signed-off-by: David S. Miller --- drivers/net/irda/Kconfig | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'drivers') diff --git a/drivers/net/irda/Kconfig b/drivers/net/irda/Kconfig index 5e6d00752990..cff8598aa800 100644 --- a/drivers/net/irda/Kconfig +++ b/drivers/net/irda/Kconfig @@ -33,7 +33,7 @@ config DONGLE config ESI_DONGLE tristate "ESI JetEye PC dongle" - depends on DONGLE && IRDA + depends on IRTTY_SIR && DONGLE && IRDA help Say Y here if you want to build support for the Extended Systems JetEye PC dongle. To compile it as a module, choose M here. The ESI @@ -44,7 +44,7 @@ config ESI_DONGLE config ACTISYS_DONGLE tristate "ACTiSYS IR-220L and IR220L+ dongle" - depends on DONGLE && IRDA + depends on IRTTY_SIR && DONGLE && IRDA help Say Y here if you want to build support for the ACTiSYS IR-220L and IR220L+ dongles. To compile it as a module, choose M here. The @@ -55,7 +55,7 @@ config ACTISYS_DONGLE config TEKRAM_DONGLE tristate "Tekram IrMate 210B dongle" - depends on DONGLE && IRDA + depends on IRTTY_SIR && DONGLE && IRDA help Say Y here if you want to build support for the Tekram IrMate 210B dongle. To compile it as a module, choose M here. The Tekram dongle @@ -66,7 +66,7 @@ config TEKRAM_DONGLE config TOIM3232_DONGLE tristate "TOIM3232 IrDa dongle" - depends on DONGLE && IRDA + depends on IRTTY_SIR && DONGLE && IRDA help Say Y here if you want to build support for the Vishay/Temic TOIM3232 and TOIM4232 based dongles. @@ -74,7 +74,7 @@ config TOIM3232_DONGLE config LITELINK_DONGLE tristate "Parallax LiteLink dongle" - depends on DONGLE && IRDA + depends on IRTTY_SIR && DONGLE && IRDA help Say Y here if you want to build support for the Parallax Litelink dongle. To compile it as a module, choose M here. The Parallax @@ -85,7 +85,7 @@ config LITELINK_DONGLE config MA600_DONGLE tristate "Mobile Action MA600 dongle" - depends on DONGLE && IRDA && EXPERIMENTAL + depends on IRTTY_SIR && DONGLE && IRDA && EXPERIMENTAL help Say Y here if you want to build support for the Mobile Action MA600 dongle. To compile it as a module, choose M here. The MA600 dongle @@ -98,7 +98,7 @@ config MA600_DONGLE config GIRBIL_DONGLE tristate "Greenwich GIrBIL dongle" - depends on DONGLE && IRDA && EXPERIMENTAL + depends on IRTTY_SIR && DONGLE && IRDA && EXPERIMENTAL help Say Y here if you want to build support for the Greenwich GIrBIL dongle. If you want to compile it as a module, choose M here. @@ -109,7 +109,7 @@ config GIRBIL_DONGLE config MCP2120_DONGLE tristate "Microchip MCP2120" - depends on DONGLE && IRDA && EXPERIMENTAL + depends on IRTTY_SIR && DONGLE && IRDA && EXPERIMENTAL help Say Y here if you want to build support for the Microchip MCP2120 dongle. If you want to compile it as a module, choose M here. @@ -123,7 +123,7 @@ config MCP2120_DONGLE config OLD_BELKIN_DONGLE tristate "Old Belkin dongle" - depends on DONGLE && IRDA && EXPERIMENTAL + depends on IRTTY_SIR && DONGLE && IRDA && EXPERIMENTAL help Say Y here if you want to build support for the Adaptec Airport 1000 and 2000 dongles. If you want to compile it as a module, choose @@ -132,7 +132,7 @@ config OLD_BELKIN_DONGLE config ACT200L_DONGLE tristate "ACTiSYS IR-200L dongle" - depends on DONGLE && IRDA && EXPERIMENTAL + depends on IRTTY_SIR && DONGLE && IRDA && EXPERIMENTAL help Say Y here if you want to build support for the ACTiSYS IR-200L dongle. If you want to compile it as a module, choose M here. -- cgit v1.2.2 From 8e30a9a299ca30b6c4072c2182238d5f5dd1590d Mon Sep 17 00:00:00 2001 From: Vitaly Bordug Date: Wed, 24 May 2006 21:40:18 +0400 Subject: [PATCH] ppc32 CPM_UART: various fixes for pq2 uart users This fixes various odd things that missed update together with cpm_uart platform_device move. Unified resources names, restructurisation, etc. Also, addressed issue with recent phys/virt translation rework. Being cache-coherent, CPM2's do alloc_bootmem() for the console stuff, and it was used to treat console buffer descriptor mapping 1:1 (as in CPM1 case), which is definitely wrong. Signed-off-by: Vitaly Bordug Signed-off-by: Paul Mackerras --- drivers/serial/cpm_uart/cpm_uart_core.c | 8 +++++--- drivers/serial/cpm_uart/cpm_uart_cpm2.c | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c index 969f94900431..5cba59ad7dc5 100644 --- a/drivers/serial/cpm_uart/cpm_uart_core.c +++ b/drivers/serial/cpm_uart/cpm_uart_core.c @@ -1164,14 +1164,16 @@ static int __init cpm_uart_console_setup(struct console *co, char *options) struct fs_uart_platform_info *pdata; struct platform_device* pdev = early_uart_get_pdev(co->index); - port = - (struct uart_port *)&cpm_uart_ports[cpm_uart_port_map[co->index]]; - pinfo = (struct uart_cpm_port *)port; if (!pdev) { pr_info("cpm_uart: console: compat mode\n"); /* compatibility - will be cleaned up */ cpm_uart_init_portdesc(); + } + port = + (struct uart_port *)&cpm_uart_ports[cpm_uart_port_map[co->index]]; + pinfo = (struct uart_cpm_port *)port; + if (!pdev) { if (pinfo->set_lineif) pinfo->set_lineif(pinfo); } else { diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm2.c b/drivers/serial/cpm_uart/cpm_uart_cpm2.c index 4b2de08f46d0..cdba128250a9 100644 --- a/drivers/serial/cpm_uart/cpm_uart_cpm2.c +++ b/drivers/serial/cpm_uart/cpm_uart_cpm2.c @@ -213,7 +213,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con) L1_CACHE_ALIGN(pinfo->tx_nrfifos * pinfo->tx_fifosize); if (is_con) { mem_addr = alloc_bootmem(memsz); - dma_addr = mem_addr; + dma_addr = virt_to_bus(mem_addr); } else mem_addr = dma_alloc_coherent(NULL, memsz, &dma_addr, -- cgit v1.2.2 From c71d48877e6f3d5e3eb22fcaaa612081bce3d089 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Fri, 26 May 2006 10:39:25 +1000 Subject: [PATCH] Unlock md devices when stopping them on reboot. otherwise we get nasty messages about locks not being released. Signed-off-by: Neil Brown Signed-off-by: Linus Torvalds --- drivers/md/md.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/md/md.c b/drivers/md/md.c index 3ca3cfb03a7e..ec802913f977 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -5028,8 +5028,10 @@ static int md_notify_reboot(struct notifier_block *this, printk(KERN_INFO "md: stopping all md devices.\n"); ITERATE_MDDEV(mddev,tmp) - if (mddev_trylock(mddev)) + if (mddev_trylock(mddev)) { do_md_stop (mddev, 1); + mddev_unlock(mddev); + } /* * certain more exotic SCSI devices are known to be * volatile wrt too early system reboots. While the -- cgit v1.2.2 From 9084533e797f131c923c8883adf91cc2f7ddcfae Mon Sep 17 00:00:00 2001 From: David Brownell Date: Thu, 25 May 2006 18:44:20 -0700 Subject: [PATCH] ads7846 conversion accuracy This improves accuracy of the touchscreen and hwmon sensor readings, addressing an issue noted by Imre Deak: there's an extra bit written before the sample (12 bits) gets written out. It also catches up to various comments, and makes the /proc/interrupts entry sensible again. Signed-off-by: David Brownell Cc: Imre Deak Cc: Jean Delvare Cc: Dmitry Torokhov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/input/touchscreen/ads7846.c | 53 ++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 25 deletions(-) (limited to 'drivers') diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index 1494175ac6fe..161afddd0f44 100644 --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c @@ -36,13 +36,10 @@ /* - * This code has been tested on an ads7846 / N770 device. + * This code has been heavily tested on a Nokia 770, and lightly + * tested on other ads7846 devices (OSK/Mistral, Lubbock). * Support for ads7843 and ads7845 has only been stubbed in. * - * Not yet done: How accurate are the temperature and voltage - * readings? (System-specific calibration should support - * accuracy of 0.3 degrees C; otherwise it's 2.0 degrees.) - * * IRQ handling needs a workaround because of a shortcoming in handling * edge triggered IRQs on some platforms like the OMAP1/2. These * platforms don't handle the ARM lazy IRQ disabling properly, thus we @@ -248,10 +245,13 @@ static int ads7846_read12_ser(struct device *dev, unsigned command) if (req->msg.status) status = req->msg.status; + + /* on-wire is a must-ignore bit, a BE12 value, then padding */ sample = be16_to_cpu(req->sample); - sample = sample >> 4; - kfree(req); + sample = sample >> 3; + sample &= 0x0fff; + kfree(req); return status ? status : sample; } @@ -336,13 +336,13 @@ static void ads7846_rx(void *ads) u16 x, y, z1, z2; unsigned long flags; - /* adjust: 12 bit samples (left aligned), built from - * two 8 bit values writen msb-first. + /* adjust: on-wire is a must-ignore bit, a BE12 value, then padding; + * built from two 8 bit values written msb-first. */ - x = be16_to_cpu(ts->tc.x) >> 4; - y = be16_to_cpu(ts->tc.y) >> 4; - z1 = be16_to_cpu(ts->tc.z1) >> 4; - z2 = be16_to_cpu(ts->tc.z2) >> 4; + x = (be16_to_cpu(ts->tc.x) >> 3) & 0x0fff; + y = (be16_to_cpu(ts->tc.y) >> 3) & 0x0fff; + z1 = (be16_to_cpu(ts->tc.z1) >> 3) & 0x0fff; + z2 = (be16_to_cpu(ts->tc.z2) >> 3) & 0x0fff; /* range filtering */ if (x == MAX_12BIT) @@ -420,7 +420,7 @@ static void ads7846_debounce(void *ads) m = &ts->msg[ts->msg_idx]; t = list_entry(m->transfers.prev, struct spi_transfer, transfer_list); - val = (*(u16 *)t->rx_buf) >> 3; + val = (be16_to_cpu(*(__be16 *)t->rx_buf) >> 3) & 0x0fff; if (!ts->read_cnt || (abs(ts->last_read - val) > ts->debounce_tol)) { /* Repeat it, if this was the first read or the read * wasn't consistent enough. */ @@ -469,7 +469,7 @@ static void ads7846_timer(unsigned long handle) spin_lock_irq(&ts->lock); if (unlikely(ts->msg_idx && !ts->pendown)) { - /* measurment cycle ended */ + /* measurement cycle ended */ if (!device_suspended(&ts->spi->dev)) { ts->irq_disabled = 0; enable_irq(ts->spi->irq); @@ -495,11 +495,10 @@ static irqreturn_t ads7846_irq(int irq, void *handle, struct pt_regs *regs) spin_lock_irqsave(&ts->lock, flags); if (likely(ts->get_pendown_state())) { if (!ts->irq_disabled) { - /* REVISIT irq logic for many ARM chips has cloned a - * bug wherein disabling an irq in its handler won't - * work;(it's disabled lazily, and too late to work. - * until all their irq logic is fixed, we must shadow - * that state here. + /* The ARM do_simple_IRQ() dispatcher doesn't act + * like the other dispatchers: it will report IRQs + * even after they've been disabled. We work around + * that here. (The "generic irq" framework may help...) */ ts->irq_disabled = 1; disable_irq(ts->spi->irq); @@ -609,16 +608,20 @@ static int __devinit ads7846_probe(struct spi_device *spi) return -EINVAL; } + /* REVISIT when the irq can be triggered active-low, or if for some + * reason the touchscreen isn't hooked up, we don't need to access + * the pendown state. + */ if (pdata->get_pendown_state == NULL) { dev_dbg(&spi->dev, "no get_pendown_state function?\n"); return -EINVAL; } - /* We'd set the wordsize to 12 bits ... except that some controllers - * will then treat the 8 bit command words as 12 bits (and drop the - * four MSBs of the 12 bit result). Result: inputs must be shifted - * to discard the four garbage LSBs. + /* We'd set TX wordsize 8 bits and RX wordsize to 13 bits ... except + * that even if the hardware can do that, the SPI controller driver + * may not. So we stick to very-portable 8 bit words, both RX and TX. */ + spi->bits_per_word = 8; ts = kzalloc(sizeof(struct ads7846), GFP_KERNEL); input_dev = input_allocate_device(); @@ -772,7 +775,7 @@ static int __devinit ads7846_probe(struct spi_device *spi) if (request_irq(spi->irq, ads7846_irq, SA_SAMPLE_RANDOM | SA_TRIGGER_FALLING, - spi->dev.bus_id, ts)) { + spi->dev.driver->name, ts)) { dev_dbg(&spi->dev, "irq %d busy?\n", spi->irq); err = -EBUSY; goto err_free_mem; -- cgit v1.2.2 From ac88bcff2fa536e015a97e144b7190c740225144 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Thu, 25 May 2006 18:44:25 -0700 Subject: [PATCH] s3c24xx: fix spi driver with CONFIG_PM Fix compile bug with the S3C24XX SPI driver when CONFIG_PM is set. Signed-off-by: Ben Dooks Cc: David Brownell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/spi/spi_s3c24xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/spi/spi_s3c24xx.c b/drivers/spi/spi_s3c24xx.c index 9de4b5a04d70..5fc14563ee3a 100644 --- a/drivers/spi/spi_s3c24xx.c +++ b/drivers/spi/spi_s3c24xx.c @@ -405,7 +405,7 @@ static int s3c24xx_spi_remove(struct platform_device *dev) static int s3c24xx_spi_suspend(struct platform_device *pdev, pm_message_t msg) { - struct s3c24xx_spi *hw = platform_get_drvdata(dev); + struct s3c24xx_spi *hw = platform_get_drvdata(pdev); clk_disable(hw->clk); return 0; @@ -413,7 +413,7 @@ static int s3c24xx_spi_suspend(struct platform_device *pdev, pm_message_t msg) static int s3c24xx_spi_resume(struct platform_device *pdev) { - struct s3c24xx_spi *hw = platform_get_drvdata(dev); + struct s3c24xx_spi *hw = platform_get_drvdata(pdev); clk_enable(hw->clk); return 0; -- cgit v1.2.2 From 5d5daa162a5187bc0f98eb2bc7a063392b0de311 Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Thu, 25 May 2006 18:44:26 -0700 Subject: [PATCH] scx200_acb: fix section mismatch warning WARNING: drivers/i2c/busses/scx200_acb.o - Section mismatch: reference to .init.text: from .text after 'scx200_add_cs553x' (at offset 0x528) Signed-off-by: Randy Dunlap Signed-off-by: Jean Delvare Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/i2c/busses/scx200_acb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/i2c/busses/scx200_acb.c b/drivers/i2c/busses/scx200_acb.c index a140e4536a4e..766cc969c4d0 100644 --- a/drivers/i2c/busses/scx200_acb.c +++ b/drivers/i2c/busses/scx200_acb.c @@ -491,7 +491,7 @@ static struct pci_device_id divil_pci[] = { #define MSR_LBAR_SMB 0x5140000B -static int scx200_add_cs553x(void) +static __init int scx200_add_cs553x(void) { u32 low, hi; u32 smb_base; -- cgit v1.2.2 From 087377a4307e18225f6452af5e71fe763c088c4e Mon Sep 17 00:00:00 2001 From: Kylene Jo Hall Date: Thu, 25 May 2006 18:44:27 -0700 Subject: [PATCH] tpm: fix bug for TPM on ThinkPad T60 and Z60 The TPM chip on the ThinkPad T60 and Z60 machines is returning 0xFFFF for the vendor ID which is a check the driver made to double check it was actually talking to the memory mapped space of a TPM. This patch removes the check since it isn't absolutely necessary and was causing device discovery to fail on these machines. Signed-off-by: Kylene Hall Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/char/tpm/tpm_tis.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'drivers') diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c index f621168f38ae..8ea70625f7ea 100644 --- a/drivers/char/tpm/tpm_tis.c +++ b/drivers/char/tpm/tpm_tis.c @@ -457,10 +457,6 @@ static int __devinit tpm_tis_pnp_init(struct pnp_dev *pnp_dev, } vendor = ioread32(chip->vendor.iobase + TPM_DID_VID(0)); - if ((vendor & 0xFFFF) == 0xFFFF) { - rc = -ENODEV; - goto out_err; - } /* Default timeouts */ chip->vendor.timeout_a = msecs_to_jiffies(TIS_SHORT_TIMEOUT); -- cgit v1.2.2 From 53072d68cc2deda9f1a8cde864aa9d04f58addd3 Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Thu, 25 May 2006 11:09:21 -0700 Subject: [PATCH] wavelan: fix section mismatch Fix section mismatch warning: WARNING: drivers/net/wireless/wavelan.o - Section mismatch: reference to .init.text: from .text between 'init_module' (at offset 0x371e) and 'cleanup_module' Signed-off-by: Randy Dunlap Signed-off-by: John W. Linville --- drivers/net/wireless/wavelan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/net/wireless/wavelan.c b/drivers/net/wireless/wavelan.c index ff192e96268a..dade4b903579 100644 --- a/drivers/net/wireless/wavelan.c +++ b/drivers/net/wireless/wavelan.c @@ -4306,7 +4306,7 @@ out: * Insertion of the module * I'm now quite proud of the multi-device support. */ -int init_module(void) +int __init init_module(void) { int ret = -EIO; /* Return error if no cards found */ int i; -- cgit v1.2.2 From 4541a5db0ba33d9c692e5b2f8d7805e336fabe7c Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Thu, 25 May 2006 11:10:08 -0700 Subject: [PATCH] arlan: fix section mismatch warnings Fix section mismatch warnings: WARNING: drivers/net/wireless/arlan.o - Section mismatch: reference to .init.text:arlan_probe from .text between 'init_module' (at offset 0x3526) and 'cleanup_module' WARNING: drivers/net/wireless/arlan.o - Section mismatch: reference to .init.text:init_arlan_proc from .text between 'init_module' (at offset 0x3539) and 'cleanup_module' WARNING: drivers/net/wireless/arlan.o - Section mismatch: reference to .exit.text:cleanup_arlan_proc from .text between 'cleanup_module' (at offset 0x356c) and 'arlan_diagnostic_info_string' Signed-off-by: Randy Dunlap Signed-off-by: John W. Linville --- drivers/net/wireless/arlan-main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/net/wireless/arlan-main.c b/drivers/net/wireless/arlan-main.c index 0e1ac338cac1..bed6823d9809 100644 --- a/drivers/net/wireless/arlan-main.c +++ b/drivers/net/wireless/arlan-main.c @@ -1838,7 +1838,7 @@ struct net_device * __init arlan_probe(int unit) } #ifdef MODULE -int init_module(void) +int __init init_module(void) { int i = 0; @@ -1860,7 +1860,7 @@ int init_module(void) } -void cleanup_module(void) +void __exit cleanup_module(void) { int i = 0; struct net_device *dev; -- cgit v1.2.2 From 80871e63e410c53524ef47eaf475c13e0f164ea6 Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Tue, 23 May 2006 13:35:57 -0700 Subject: e1000: add shutdown handler back to fix WOL Someone was waaay too aggressive and removed e1000's reboot notifier instead of porting it to the new way of the shutdown handler. This change broke wake on lan. Add the shutdown handler back in using the same method as e100 uses. Signed-off-by: Jesse Brandeburg Signed-off-by: Auke Kok (cherry picked from c653e6351e371b33b29871e5eedf610ffb3be037 commit) --- drivers/net/e1000/e1000_main.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index c99e87838f92..ed15fcaedaf9 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c @@ -220,6 +220,7 @@ static void e1000_restore_vlan(struct e1000_adapter *adapter); static int e1000_suspend(struct pci_dev *pdev, pm_message_t state); static int e1000_resume(struct pci_dev *pdev); #endif +static void e1000_shutdown(struct pci_dev *pdev); #ifdef CONFIG_NET_POLL_CONTROLLER /* for netdump / net console */ @@ -235,8 +236,9 @@ static struct pci_driver e1000_driver = { /* Power Managment Hooks */ #ifdef CONFIG_PM .suspend = e1000_suspend, - .resume = e1000_resume + .resume = e1000_resume, #endif + .shutdown = e1000_shutdown }; MODULE_AUTHOR("Intel Corporation, "); @@ -4611,6 +4613,12 @@ e1000_resume(struct pci_dev *pdev) return 0; } #endif + +static void e1000_shutdown(struct pci_dev *pdev) +{ + e1000_suspend(pdev, PMSG_SUSPEND); +} + #ifdef CONFIG_NET_POLL_CONTROLLER /* * Polling 'interrupt' - used by things like netconsole to send skbs -- cgit v1.2.2 From a24b163b7c16f9e30e726319115e45ed6e683582 Mon Sep 17 00:00:00 2001 From: Don Fry Date: Thu, 25 May 2006 16:22:40 -0700 Subject: [PATCH] pcnet32: remove incorrect pcnet32_free_ring During a code scan for another change I discovered that this call to pcnet32_free_ring must be removed. If the open fails due to a lack of memory all the ring structures are removed via the call to free_ring and a subsequent call to open will dereference a null pointer in pcnet32_init_ring. Please apply to 2.6.17. Signed-off-by: Don Fry Signed-off-by: Jeff Garzik --- drivers/net/pcnet32.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'drivers') diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c index 07c31f19c6ba..fc08c4af506c 100644 --- a/drivers/net/pcnet32.c +++ b/drivers/net/pcnet32.c @@ -1774,8 +1774,6 @@ static int pcnet32_open(struct net_device *dev) lp->rx_dma_addr[i] = 0; } - pcnet32_free_ring(dev); - /* * Switch back to 16bit mode to avoid problems with dumb * DOS packet driver after a warm reboot -- cgit v1.2.2 From 7401a4670f0e81d50dcc4e0a7bd2dcb4a5d65e6b Mon Sep 17 00:00:00 2001 From: Cornelia Huck Date: Wed, 24 May 2006 09:51:05 +0200 Subject: [PATCH] s390: minor fix in cu3088 In case of a parse error for the cu3088 group attribute, return -EINVAL instead of count. Signed-off-by: Frank Pavlic Signed-off-by: Jeff Garzik --- drivers/s390/net/cu3088.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/s390/net/cu3088.c b/drivers/s390/net/cu3088.c index b12533104c1f..e1b8c9a9634f 100644 --- a/drivers/s390/net/cu3088.c +++ b/drivers/s390/net/cu3088.c @@ -77,7 +77,7 @@ group_write(struct device_driver *drv, const char *buf, size_t count) int len; if (!(end = strchr(start, delim[i]))) - return count; + return -EINVAL; len = min_t(ptrdiff_t, BUS_ID_SIZE, end - start + 1); strlcpy (bus_ids[i], start, len); argv[i] = bus_ids[i]; -- cgit v1.2.2 From b85e1fa196da91e07c98eaf014ae773c2a2e0c4f Mon Sep 17 00:00:00 2001 From: Ursula Braun Date: Wed, 24 May 2006 09:51:11 +0200 Subject: [PATCH] s390: qeth driver fixes From: Frank Pavlic - correct checking of sscanf-%n value in qeth_string_to_ipaddr(). - don't use netif_stop_queue outside the hard_start_xmit routine. Rather use netif_tx_disable. - don't call qeth_netdev_init on a recovery. Signed-off-by: Frank Pavlic Signed-off-by: Jeff Garzik --- drivers/s390/net/qeth.h | 2 +- drivers/s390/net/qeth_main.c | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'drivers') diff --git a/drivers/s390/net/qeth.h b/drivers/s390/net/qeth.h index 4df0fcd7b10b..65e2b1bc08a5 100644 --- a/drivers/s390/net/qeth.h +++ b/drivers/s390/net/qeth.h @@ -1099,7 +1099,7 @@ qeth_string_to_ipaddr4(const char *buf, __u8 *addr) rc = sscanf(buf, "%d.%d.%d.%d%n", &in[0], &in[1], &in[2], &in[3], &count); - if (rc != 4 || count) + if (rc != 4 || count<=0) return -EINVAL; for (count = 0; count < 4; count++) { if (in[count] > 255) diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index cb14642d97aa..0f6648fdec1d 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c @@ -3817,7 +3817,7 @@ qeth_stop(struct net_device *dev) card = (struct qeth_card *) dev->priv; - netif_stop_queue(dev); + netif_tx_disable(dev); card->dev->flags &= ~IFF_UP; if (card->state == CARD_STATE_UP) card->state = CARD_STATE_SOFTSETUP; @@ -6359,12 +6359,9 @@ qeth_netdev_init(struct net_device *dev) dev->vlan_rx_kill_vid = qeth_vlan_rx_kill_vid; dev->vlan_rx_add_vid = qeth_vlan_rx_add_vid; #endif - dev->hard_header = card->orig_hard_header; if (qeth_get_netdev_flags(card) & IFF_NOARP) { dev->rebuild_header = NULL; dev->hard_header = NULL; - if (card->options.fake_ll) - dev->hard_header = qeth_fake_header; dev->header_cache_update = NULL; dev->hard_header_cache = NULL; } @@ -6477,6 +6474,9 @@ retry: /*network device will be recovered*/ if (card->dev) { card->dev->hard_header = card->orig_hard_header; + if (card->options.fake_ll && + (qeth_get_netdev_flags(card) & IFF_NOARP)) + card->dev->hard_header = qeth_fake_header; return 0; } /* at first set_online allocate netdev */ @@ -7031,7 +7031,7 @@ qeth_softsetup_ipv6(struct qeth_card *card) QETH_DBF_TEXT(trace,3,"softipv6"); - netif_stop_queue(card->dev); + netif_tx_disable(card->dev); rc = qeth_send_startlan(card, QETH_PROT_IPV6); if (rc) { PRINT_ERR("IPv6 startlan failed on %s\n", @@ -7352,7 +7352,8 @@ qeth_set_large_send(struct qeth_card *card, enum qeth_large_send_types type) card->options.large_send = type; return 0; } - netif_stop_queue(card->dev); + if (card->state == CARD_STATE_UP) + netif_tx_disable(card->dev); card->options.large_send = type; switch (card->options.large_send) { case QETH_LARGE_SEND_EDDP: @@ -7374,7 +7375,8 @@ qeth_set_large_send(struct qeth_card *card, enum qeth_large_send_types type) card->dev->features &= ~(NETIF_F_TSO | NETIF_F_SG); break; } - netif_wake_queue(card->dev); + if (card->state == CARD_STATE_UP) + netif_wake_queue(card->dev); return rc; } @@ -7427,7 +7429,7 @@ qeth_softsetup_card(struct qeth_card *card) if ((rc = qeth_setrouting_v6(card))) QETH_DBF_TEXT_(setup, 2, "5err%d", rc); out: - netif_stop_queue(card->dev); + netif_tx_disable(card->dev); return 0; } @@ -7736,10 +7738,8 @@ static int qeth_register_netdev(struct qeth_card *card) { QETH_DBF_TEXT(setup, 3, "regnetd"); - if (card->dev->reg_state != NETREG_UNINITIALIZED) { - qeth_netdev_init(card->dev); + if (card->dev->reg_state != NETREG_UNINITIALIZED) return 0; - } /* sysfs magic */ SET_NETDEV_DEV(card->dev, &card->gdev->dev); return register_netdev(card->dev); -- cgit v1.2.2 From ba1aa084d6fb725a4c026adf69845ca60bab3b36 Mon Sep 17 00:00:00 2001 From: Ursula Braun Date: Wed, 24 May 2006 09:51:13 +0200 Subject: [PATCH] s390: qeth driver fixes From: Frank Blaschka From: Frank Pavlic - fix fake_ll during initial device bringup. fake_ll was not active after first start of the device. Problem only occured when qeth was built without IPV6 support. - avoid skb usage after invocation of qeth_flush_buffers, because skb might already be freed. - remove yet another useless netif_wake_queue in qeth_softsetup_ipv6 since this function is only called when device is going online. In this case card->state will never be in state UP. So let the net_device queue down . Signed-off-by: Frank Pavlic Signed-off-by: Jeff Garzik --- drivers/s390/net/qeth_main.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'drivers') diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index 0f6648fdec1d..9dbb5be2b63c 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c @@ -3798,11 +3798,11 @@ qeth_open(struct net_device *dev) QETH_DBF_TEXT(trace,4,"nomacadr"); return -EPERM; } - card->dev->flags |= IFF_UP; - netif_start_queue(dev); card->data.state = CH_STATE_UP; card->state = CARD_STATE_UP; - + card->dev->flags |= IFF_UP; + netif_start_queue(dev); + if (!card->lan_online && netif_carrier_ok(dev)) netif_carrier_off(dev); return 0; @@ -3958,7 +3958,7 @@ qeth_prepare_skb(struct qeth_card *card, struct sk_buff **skb, #endif *hdr = (struct qeth_hdr *) qeth_push_skb(card, skb, sizeof(struct qeth_hdr)); - if (hdr == NULL) + if (*hdr == NULL) return -EINVAL; return 0; } @@ -4416,6 +4416,8 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb) enum qeth_large_send_types large_send = QETH_LARGE_SEND_NO; struct qeth_eddp_context *ctx = NULL; int tx_bytes = skb->len; + unsigned short nr_frags = skb_shinfo(skb)->nr_frags; + unsigned short tso_size = skb_shinfo(skb)->tso_size; int rc; QETH_DBF_TEXT(trace, 6, "sendpkt"); @@ -4498,16 +4500,16 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb) card->stats.tx_packets++; card->stats.tx_bytes += tx_bytes; #ifdef CONFIG_QETH_PERF_STATS - if (skb_shinfo(skb)->tso_size && + if (tso_size && !(large_send == QETH_LARGE_SEND_NO)) { - card->perf_stats.large_send_bytes += skb->len; + card->perf_stats.large_send_bytes += tx_bytes; card->perf_stats.large_send_cnt++; } - if (skb_shinfo(skb)->nr_frags > 0){ + if (nr_frags > 0){ card->perf_stats.sg_skbs_sent++; /* nr_frags + skb->data */ card->perf_stats.sg_frags_sent += - skb_shinfo(skb)->nr_frags + 1; + nr_frags + 1; } #endif /* CONFIG_QETH_PERF_STATS */ } @@ -6370,6 +6372,9 @@ qeth_netdev_init(struct net_device *dev) if (!(card->info.unique_id & UNIQUE_ID_NOT_BY_CARD)) card->dev->dev_id = card->info.unique_id & 0xffff; #endif + if (card->options.fake_ll && + (qeth_get_netdev_flags(card) & IFF_NOARP)) + dev->hard_header = qeth_fake_header; dev->hard_header_parse = NULL; dev->set_mac_address = qeth_layer2_set_mac_address; dev->flags |= qeth_get_netdev_flags(card); @@ -7031,14 +7036,12 @@ qeth_softsetup_ipv6(struct qeth_card *card) QETH_DBF_TEXT(trace,3,"softipv6"); - netif_tx_disable(card->dev); rc = qeth_send_startlan(card, QETH_PROT_IPV6); if (rc) { PRINT_ERR("IPv6 startlan failed on %s\n", QETH_CARD_IFNAME(card)); return rc; } - netif_wake_queue(card->dev); rc = qeth_query_ipassists(card,QETH_PROT_IPV6); if (rc) { PRINT_ERR("IPv6 query ipassist failed on %s\n", -- cgit v1.2.2 From 27eb5ac8f015687205a51425620064c711784956 Mon Sep 17 00:00:00 2001 From: Klaus Wacker Date: Wed, 24 May 2006 09:51:17 +0200 Subject: [PATCH] s390: lcs driver bug fixes and improvements [1/2] Several problems occured with lcs device driver: - device not operational anymore after cable pull/plug-in. - unpredictable results occured, e.g. kernel panic using cards of type QD8F. - STOPLAN and delete multicast address command were not proper recognized by OSA card under heavy network workload. - channel/device error checks missing in interrupt handler. To fix all problems at once recovery of lcs devices has been improved. missing error checks in lcs interrupt handler has been added. Once a hardware problem occurs lcs will recover the device now properly. Signed-off-by: Frank Pavlic Signed-off-by: Jeff Garzik --- drivers/s390/net/lcs.c | 341 +++++++++++++++++++++++++------------------------ 1 file changed, 171 insertions(+), 170 deletions(-) (limited to 'drivers') diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c index e65da921a827..c915bb5d5a93 100644 --- a/drivers/s390/net/lcs.c +++ b/drivers/s390/net/lcs.c @@ -68,6 +68,7 @@ static void lcs_tasklet(unsigned long); static void lcs_start_kernel_thread(struct lcs_card *card); static void lcs_get_frames_cb(struct lcs_channel *, struct lcs_buffer *); static int lcs_send_delipm(struct lcs_card *, struct lcs_ipm_list *); +static int lcs_recovery(void *ptr); /** * Debug Facility Stuff @@ -429,12 +430,6 @@ lcs_setup_card(struct lcs_card *card) card->tx_buffer = NULL; card->tx_emitted = 0; - /* Initialize kernel thread task used for LGW commands. */ - INIT_WORK(&card->kernel_thread_starter, - (void *)lcs_start_kernel_thread,card); - card->thread_start_mask = 0; - card->thread_allowed_mask = 0; - card->thread_running_mask = 0; init_waitqueue_head(&card->wait_q); spin_lock_init(&card->lock); spin_lock_init(&card->ipm_lock); @@ -675,8 +670,9 @@ lcs_ready_buffer(struct lcs_channel *channel, struct lcs_buffer *buffer) int index, rc; LCS_DBF_TEXT(5, trace, "rdybuff"); - BUG_ON(buffer->state != BUF_STATE_LOCKED && - buffer->state != BUF_STATE_PROCESSED); + if (buffer->state != BUF_STATE_LOCKED && + buffer->state != BUF_STATE_PROCESSED) + BUG(); spin_lock_irqsave(get_ccwdev_lock(channel->ccwdev), flags); buffer->state = BUF_STATE_READY; index = buffer - channel->iob; @@ -700,7 +696,8 @@ __lcs_processed_buffer(struct lcs_channel *channel, struct lcs_buffer *buffer) int index, prev, next; LCS_DBF_TEXT(5, trace, "prcsbuff"); - BUG_ON(buffer->state != BUF_STATE_READY); + if (buffer->state != BUF_STATE_READY) + BUG(); buffer->state = BUF_STATE_PROCESSED; index = buffer - channel->iob; prev = (index - 1) & (LCS_NUM_BUFFS - 1); @@ -732,8 +729,9 @@ lcs_release_buffer(struct lcs_channel *channel, struct lcs_buffer *buffer) unsigned long flags; LCS_DBF_TEXT(5, trace, "relbuff"); - BUG_ON(buffer->state != BUF_STATE_LOCKED && - buffer->state != BUF_STATE_PROCESSED); + if (buffer->state != BUF_STATE_LOCKED && + buffer->state != BUF_STATE_PROCESSED) + BUG(); spin_lock_irqsave(get_ccwdev_lock(channel->ccwdev), flags); buffer->state = BUF_STATE_EMPTY; spin_unlock_irqrestore(get_ccwdev_lock(channel->ccwdev), flags); @@ -1147,8 +1145,6 @@ list_modified: list_add_tail(&ipm->list, &card->ipm_list); } spin_unlock_irqrestore(&card->ipm_lock, flags); - if (card->state == DEV_STATE_UP) - netif_wake_queue(card->dev); } /** @@ -1231,17 +1227,17 @@ lcs_set_mc_addresses(struct lcs_card *card, struct in_device *in4_dev) if (ipm != NULL) continue; /* Address already in list. */ ipm = (struct lcs_ipm_list *) - kmalloc(sizeof(struct lcs_ipm_list), GFP_ATOMIC); + kzalloc(sizeof(struct lcs_ipm_list), GFP_ATOMIC); if (ipm == NULL) { PRINT_INFO("Not enough memory to add " "new multicast entry!\n"); break; } - memset(ipm, 0, sizeof(struct lcs_ipm_list)); memcpy(&ipm->ipm.mac_addr, buf, LCS_MAC_LENGTH); ipm->ipm.ip_addr = im4->multiaddr; ipm->ipm_state = LCS_IPM_STATE_SET_REQUIRED; spin_lock_irqsave(&card->ipm_lock, flags); + LCS_DBF_HEX(2,trace,&ipm->ipm.ip_addr,4); list_add(&ipm->list, &card->ipm_list); spin_unlock_irqrestore(&card->ipm_lock, flags); } @@ -1269,7 +1265,15 @@ lcs_register_mc_addresses(void *data) read_unlock(&in4_dev->mc_list_lock); in_dev_put(in4_dev); + netif_carrier_off(card->dev); + netif_tx_disable(card->dev); + wait_event(card->write.wait_q, + (card->write.state != CH_STATE_RUNNING)); lcs_fix_multicast_list(card); + if (card->state == DEV_STATE_UP) { + netif_carrier_on(card->dev); + netif_wake_queue(card->dev); + } out: lcs_clear_thread_running_bit(card, LCS_SET_MC_THREAD); return 0; @@ -1318,6 +1322,53 @@ lcs_check_irb_error(struct ccw_device *cdev, struct irb *irb) return PTR_ERR(irb); } +static int +lcs_get_problem(struct ccw_device *cdev, struct irb *irb) +{ + int dstat, cstat; + char *sense; + + sense = (char *) irb->ecw; + cstat = irb->scsw.cstat; + dstat = irb->scsw.dstat; + + if (cstat & (SCHN_STAT_CHN_CTRL_CHK | SCHN_STAT_INTF_CTRL_CHK | + SCHN_STAT_CHN_DATA_CHK | SCHN_STAT_CHAIN_CHECK | + SCHN_STAT_PROT_CHECK | SCHN_STAT_PROG_CHECK)) { + LCS_DBF_TEXT(2, trace, "CGENCHK"); + return 1; + } + if (dstat & DEV_STAT_UNIT_CHECK) { + if (sense[LCS_SENSE_BYTE_1] & + LCS_SENSE_RESETTING_EVENT) { + LCS_DBF_TEXT(2, trace, "REVIND"); + return 1; + } + if (sense[LCS_SENSE_BYTE_0] & + LCS_SENSE_CMD_REJECT) { + LCS_DBF_TEXT(2, trace, "CMDREJ"); + return 0; + } + if ((!sense[LCS_SENSE_BYTE_0]) && + (!sense[LCS_SENSE_BYTE_1]) && + (!sense[LCS_SENSE_BYTE_2]) && + (!sense[LCS_SENSE_BYTE_3])) { + LCS_DBF_TEXT(2, trace, "ZEROSEN"); + return 0; + } + LCS_DBF_TEXT(2, trace, "DGENCHK"); + return 1; + } + return 0; +} + +void +lcs_schedule_recovery(struct lcs_card *card) +{ + LCS_DBF_TEXT(2, trace, "startrec"); + if (!lcs_set_thread_start_bit(card, LCS_RECOVERY_THREAD)) + schedule_work(&card->kernel_thread_starter); +} /** * IRQ Handler for LCS channels @@ -1327,7 +1378,8 @@ lcs_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb) { struct lcs_card *card; struct lcs_channel *channel; - int index; + int rc, index; + int cstat, dstat; if (lcs_check_irb_error(cdev, irb)) return; @@ -1338,10 +1390,23 @@ lcs_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb) else channel = &card->write; + cstat = irb->scsw.cstat; + dstat = irb->scsw.dstat; LCS_DBF_TEXT_(5, trace, "Rint%s",cdev->dev.bus_id); LCS_DBF_TEXT_(5, trace, "%4x%4x",irb->scsw.cstat, irb->scsw.dstat); LCS_DBF_TEXT_(5, trace, "%4x%4x",irb->scsw.fctl, irb->scsw.actl); + /* Check for channel and device errors presented */ + rc = lcs_get_problem(cdev, irb); + if (rc || (dstat & DEV_STAT_UNIT_EXCEP)) { + PRINT_WARN("check on device %s, dstat=0x%X, cstat=0x%X \n", + cdev->dev.bus_id, dstat, cstat); + if (rc) { + lcs_schedule_recovery(card); + wake_up(&card->wait_q); + return; + } + } /* How far in the ccw chain have we processed? */ if ((channel->state != CH_STATE_INIT) && (irb->scsw.fctl & SCSW_FCTL_START_FUNC)) { @@ -1367,7 +1432,6 @@ lcs_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb) else if (irb->scsw.actl & SCSW_ACTL_SUSPENDED) /* CCW execution stopped on a suspend bit. */ channel->state = CH_STATE_SUSPENDED; - if (irb->scsw.fctl & SCSW_FCTL_HALT_FUNC) { if (irb->scsw.cc != 0) { ccw_device_halt(channel->ccwdev, (addr_t) channel); @@ -1376,7 +1440,6 @@ lcs_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb) /* The channel has been stopped by halt_IO. */ channel->state = CH_STATE_HALTED; } - if (irb->scsw.fctl & SCSW_FCTL_CLEAR_FUNC) { channel->state = CH_STATE_CLEARED; } @@ -1452,7 +1515,7 @@ lcs_txbuffer_cb(struct lcs_channel *channel, struct lcs_buffer *buffer) lcs_release_buffer(channel, buffer); card = (struct lcs_card *) ((char *) channel - offsetof(struct lcs_card, write)); - if (netif_queue_stopped(card->dev)) + if (netif_queue_stopped(card->dev) && netif_carrier_ok(card->dev)) netif_wake_queue(card->dev); spin_lock(&card->lock); card->tx_emitted--; @@ -1488,6 +1551,10 @@ __lcs_start_xmit(struct lcs_card *card, struct sk_buff *skb, card->stats.tx_carrier_errors++; return 0; } + if (skb->protocol == htons(ETH_P_IPV6)) { + dev_kfree_skb(skb); + return 0; + } netif_stop_queue(card->dev); spin_lock(&card->lock); if (card->tx_buffer != NULL && @@ -1632,30 +1699,6 @@ lcs_detect(struct lcs_card *card) return rc; } -/** - * reset card - */ -static int -lcs_resetcard(struct lcs_card *card) -{ - int retries; - - LCS_DBF_TEXT(2, trace, "rescard"); - for (retries = 0; retries < 10; retries++) { - if (lcs_detect(card) == 0) { - netif_wake_queue(card->dev); - card->state = DEV_STATE_UP; - PRINT_INFO("LCS device %s successfully restarted!\n", - card->dev->name); - return 0; - } - msleep(3000); - } - PRINT_ERR("Error in Reseting LCS card!\n"); - return -EIO; -} - - /** * LCS Stop card */ @@ -1679,111 +1722,6 @@ lcs_stopcard(struct lcs_card *card) return rc; } -/** - * LGW initiated commands - */ -static int -lcs_lgw_startlan_thread(void *data) -{ - struct lcs_card *card; - - card = (struct lcs_card *) data; - daemonize("lgwstpln"); - - if (!lcs_do_run_thread(card, LCS_STARTLAN_THREAD)) - return 0; - LCS_DBF_TEXT(4, trace, "lgwstpln"); - if (card->dev) - netif_stop_queue(card->dev); - if (lcs_startlan(card) == 0) { - netif_wake_queue(card->dev); - card->state = DEV_STATE_UP; - PRINT_INFO("LCS Startlan for device %s succeeded!\n", - card->dev->name); - - } else - PRINT_ERR("LCS Startlan for device %s failed!\n", - card->dev->name); - lcs_clear_thread_running_bit(card, LCS_STARTLAN_THREAD); - return 0; -} - -/** - * Send startup command initiated by Lan Gateway - */ -static int -lcs_lgw_startup_thread(void *data) -{ - int rc; - - struct lcs_card *card; - - card = (struct lcs_card *) data; - daemonize("lgwstaln"); - - if (!lcs_do_run_thread(card, LCS_STARTUP_THREAD)) - return 0; - LCS_DBF_TEXT(4, trace, "lgwstaln"); - if (card->dev) - netif_stop_queue(card->dev); - rc = lcs_send_startup(card, LCS_INITIATOR_LGW); - if (rc != 0) { - PRINT_ERR("Startup for LCS device %s initiated " \ - "by LGW failed!\nReseting card ...\n", - card->dev->name); - /* do a card reset */ - rc = lcs_resetcard(card); - if (rc == 0) - goto Done; - } - rc = lcs_startlan(card); - if (rc == 0) { - netif_wake_queue(card->dev); - card->state = DEV_STATE_UP; - } -Done: - if (rc == 0) - PRINT_INFO("LCS Startup for device %s succeeded!\n", - card->dev->name); - else - PRINT_ERR("LCS Startup for device %s failed!\n", - card->dev->name); - lcs_clear_thread_running_bit(card, LCS_STARTUP_THREAD); - return 0; -} - - -/** - * send stoplan command initiated by Lan Gateway - */ -static int -lcs_lgw_stoplan_thread(void *data) -{ - struct lcs_card *card; - int rc; - - card = (struct lcs_card *) data; - daemonize("lgwstop"); - - if (!lcs_do_run_thread(card, LCS_STOPLAN_THREAD)) - return 0; - LCS_DBF_TEXT(4, trace, "lgwstop"); - if (card->dev) - netif_stop_queue(card->dev); - if (lcs_send_stoplan(card, LCS_INITIATOR_LGW) == 0) - PRINT_INFO("Stoplan for %s initiated by LGW succeeded!\n", - card->dev->name); - else - PRINT_ERR("Stoplan %s initiated by LGW failed!\n", - card->dev->name); - /*Try to reset the card, stop it on failure */ - rc = lcs_resetcard(card); - if (rc != 0) - rc = lcs_stopcard(card); - lcs_clear_thread_running_bit(card, LCS_STOPLAN_THREAD); - return rc; -} - /** * Kernel Thread helper functions for LGW initiated commands */ @@ -1791,15 +1729,12 @@ static void lcs_start_kernel_thread(struct lcs_card *card) { LCS_DBF_TEXT(5, trace, "krnthrd"); - if (lcs_do_start_thread(card, LCS_STARTUP_THREAD)) - kernel_thread(lcs_lgw_startup_thread, (void *) card, SIGCHLD); - if (lcs_do_start_thread(card, LCS_STARTLAN_THREAD)) - kernel_thread(lcs_lgw_startlan_thread, (void *) card, SIGCHLD); - if (lcs_do_start_thread(card, LCS_STOPLAN_THREAD)) - kernel_thread(lcs_lgw_stoplan_thread, (void *) card, SIGCHLD); + if (lcs_do_start_thread(card, LCS_RECOVERY_THREAD)) + kernel_thread(lcs_recovery, (void *) card, SIGCHLD); #ifdef CONFIG_IP_MULTICAST if (lcs_do_start_thread(card, LCS_SET_MC_THREAD)) - kernel_thread(lcs_register_mc_addresses, (void *) card, SIGCHLD); + kernel_thread(lcs_register_mc_addresses, + (void *) card, SIGCHLD); #endif } @@ -1813,19 +1748,14 @@ lcs_get_control(struct lcs_card *card, struct lcs_cmd *cmd) if (cmd->initiator == LCS_INITIATOR_LGW) { switch(cmd->cmd_code) { case LCS_CMD_STARTUP: - if (!lcs_set_thread_start_bit(card, - LCS_STARTUP_THREAD)) - schedule_work(&card->kernel_thread_starter); - break; case LCS_CMD_STARTLAN: - if (!lcs_set_thread_start_bit(card, - LCS_STARTLAN_THREAD)) - schedule_work(&card->kernel_thread_starter); + lcs_schedule_recovery(card); break; case LCS_CMD_STOPLAN: - if (!lcs_set_thread_start_bit(card, - LCS_STOPLAN_THREAD)) - schedule_work(&card->kernel_thread_starter); + PRINT_WARN("Stoplan for %s initiated by LGW.\n", + card->dev->name); + if (card->dev) + netif_carrier_off(card->dev); break; default: PRINT_INFO("UNRECOGNIZED LGW COMMAND\n"); @@ -1941,8 +1871,11 @@ lcs_stop_device(struct net_device *dev) LCS_DBF_TEXT(2, trace, "stopdev"); card = (struct lcs_card *) dev->priv; - netif_stop_queue(dev); + netif_carrier_off(dev); + netif_tx_disable(dev); dev->flags &= ~IFF_UP; + wait_event(card->write.wait_q, + (card->write.state != CH_STATE_RUNNING)); rc = lcs_stopcard(card); if (rc) PRINT_ERR("Try it again!\n "); @@ -1968,6 +1901,7 @@ lcs_open_device(struct net_device *dev) } else { dev->flags |= IFF_UP; + netif_carrier_on(dev); netif_wake_queue(dev); card->state = DEV_STATE_UP; } @@ -2059,10 +1993,31 @@ lcs_timeout_store (struct device *dev, struct device_attribute *attr, const char DEVICE_ATTR(lancmd_timeout, 0644, lcs_timeout_show, lcs_timeout_store); +static ssize_t +lcs_dev_recover_store(struct device *dev, struct device_attribute *attr, + const char *buf, size_t count) +{ + struct lcs_card *card = dev->driver_data; + char *tmp; + int i; + + if (!card) + return -EINVAL; + if (card->state != DEV_STATE_UP) + return -EPERM; + i = simple_strtoul(buf, &tmp, 16); + if (i == 1) + lcs_schedule_recovery(card); + return count; +} + +static DEVICE_ATTR(recover, 0200, NULL, lcs_dev_recover_store); + static struct attribute * lcs_attrs[] = { &dev_attr_portno.attr, &dev_attr_type.attr, &dev_attr_lancmd_timeout.attr, + &dev_attr_recover.attr, NULL, }; @@ -2099,6 +2054,12 @@ lcs_probe_device(struct ccwgroup_device *ccwgdev) ccwgdev->dev.driver_data = card; ccwgdev->cdev[0]->handler = lcs_irq; ccwgdev->cdev[1]->handler = lcs_irq; + card->gdev = ccwgdev; + INIT_WORK(&card->kernel_thread_starter, + (void *) lcs_start_kernel_thread, card); + card->thread_start_mask = 0; + card->thread_allowed_mask = 0; + card->thread_running_mask = 0; return 0; } @@ -2200,6 +2161,7 @@ netdev_out: if (recover_state == DEV_STATE_RECOVER) { lcs_set_multicast_list(card->dev); card->dev->flags |= IFF_UP; + netif_carrier_on(card->dev); netif_wake_queue(card->dev); card->state = DEV_STATE_UP; } else { @@ -2229,7 +2191,7 @@ out: * lcs_shutdown_device, called when setting the group device offline. */ static int -lcs_shutdown_device(struct ccwgroup_device *ccwgdev) +__lcs_shutdown_device(struct ccwgroup_device *ccwgdev, int recovery_mode) { struct lcs_card *card; enum lcs_dev_states recover_state; @@ -2239,9 +2201,11 @@ lcs_shutdown_device(struct ccwgroup_device *ccwgdev) card = (struct lcs_card *)ccwgdev->dev.driver_data; if (!card) return -ENODEV; - lcs_set_allowed_threads(card, 0); - if (lcs_wait_for_threads(card, LCS_SET_MC_THREAD)) - return -ERESTARTSYS; + if (recovery_mode == 0) { + lcs_set_allowed_threads(card, 0); + if (lcs_wait_for_threads(card, LCS_SET_MC_THREAD)) + return -ERESTARTSYS; + } LCS_DBF_HEX(3, setup, &card, sizeof(void*)); recover_state = card->state; @@ -2256,6 +2220,43 @@ lcs_shutdown_device(struct ccwgroup_device *ccwgdev) return 0; } +static int +lcs_shutdown_device(struct ccwgroup_device *ccwgdev) +{ + return __lcs_shutdown_device(ccwgdev, 0); +} + +/** + * drive lcs recovery after startup and startlan initiated by Lan Gateway + */ +static int +lcs_recovery(void *ptr) +{ + struct lcs_card *card; + struct ccwgroup_device *gdev; + int rc; + + card = (struct lcs_card *) ptr; + daemonize("lcs_recover"); + + LCS_DBF_TEXT(4, trace, "recover1"); + if (!lcs_do_run_thread(card, LCS_RECOVERY_THREAD)) + return 0; + LCS_DBF_TEXT(4, trace, "recover2"); + gdev = card->gdev; + PRINT_WARN("Recovery of device %s started...\n", gdev->dev.bus_id); + rc = __lcs_shutdown_device(gdev, 1); + rc = lcs_new_device(gdev); + if (!rc) + PRINT_INFO("Device %s successfully recovered!\n", + card->dev->name); + else + PRINT_INFO("Device %s could not be recovered!\n", + card->dev->name); + lcs_clear_thread_running_bit(card, LCS_RECOVERY_THREAD); + return 0; +} + /** * lcs_remove_device, free buffers and card */ -- cgit v1.2.2 From 74ef872c8f250acc02add54ff9d96f31d17bfeb3 Mon Sep 17 00:00:00 2001 From: Klaus Wacker Date: Wed, 24 May 2006 09:51:21 +0200 Subject: [PATCH] s390: lcs driver bug fixes and improvements [2/2] This is the second lcs driver patch containing the rest of lcs fixes. Signed-off-by: Frank Pavlic Signed-off-by: Jeff Garzik --- drivers/s390/net/lcs.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'drivers') diff --git a/drivers/s390/net/lcs.h b/drivers/s390/net/lcs.h index 2fad5e40c2e4..93143932983b 100644 --- a/drivers/s390/net/lcs.h +++ b/drivers/s390/net/lcs.h @@ -73,13 +73,17 @@ do { \ /** * LCS sense byte definitions */ +#define LCS_SENSE_BYTE_0 0 +#define LCS_SENSE_BYTE_1 1 +#define LCS_SENSE_BYTE_2 2 +#define LCS_SENSE_BYTE_3 3 #define LCS_SENSE_INTERFACE_DISCONNECT 0x01 #define LCS_SENSE_EQUIPMENT_CHECK 0x10 #define LCS_SENSE_BUS_OUT_CHECK 0x20 #define LCS_SENSE_INTERVENTION_REQUIRED 0x40 #define LCS_SENSE_CMD_REJECT 0x80 -#define LCS_SENSE_RESETTING_EVENT 0x0080 -#define LCS_SENSE_DEVICE_ONLINE 0x0020 +#define LCS_SENSE_RESETTING_EVENT 0x80 +#define LCS_SENSE_DEVICE_ONLINE 0x20 /** * LCS packet type definitions @@ -152,10 +156,9 @@ enum lcs_dev_states { enum lcs_threads { LCS_SET_MC_THREAD = 1, - LCS_STARTLAN_THREAD = 2, - LCS_STOPLAN_THREAD = 4, - LCS_STARTUP_THREAD = 8, + LCS_RECOVERY_THREAD = 2, }; + /** * LCS struct declarations */ @@ -286,6 +289,7 @@ struct lcs_card { struct net_device_stats stats; unsigned short (*lan_type_trans)(struct sk_buff *skb, struct net_device *dev); + struct ccwgroup_device *gdev; struct lcs_channel read; struct lcs_channel write; struct lcs_buffer *tx_buffer; -- cgit v1.2.2 From e82b0f2cc21be905e504573483fa9542b15df96f Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Fri, 26 May 2006 21:58:38 -0400 Subject: [netdrvr s/390] trim trailing whitespace Previous fix patches added a bunch of trailing whitespace, which git-applymbox complained loudly about. --- drivers/s390/net/ctcmain.c | 26 +- drivers/s390/net/ctctty.c | 10 +- drivers/s390/net/cu3088.c | 8 +- drivers/s390/net/iucv.c | 36 +-- drivers/s390/net/iucv.h | 622 +++++++++++++++++++++---------------------- drivers/s390/net/lcs.c | 10 +- drivers/s390/net/netiucv.c | 36 +-- drivers/s390/net/qeth.h | 16 +- drivers/s390/net/qeth_eddp.c | 18 +- drivers/s390/net/qeth_fs.h | 2 +- drivers/s390/net/qeth_main.c | 74 ++--- drivers/s390/net/qeth_mpc.h | 4 +- drivers/s390/net/qeth_proc.c | 8 +- drivers/s390/net/qeth_sys.c | 6 +- drivers/s390/net/qeth_tso.h | 4 +- 15 files changed, 440 insertions(+), 440 deletions(-) (limited to 'drivers') diff --git a/drivers/s390/net/ctcmain.c b/drivers/s390/net/ctcmain.c index af9f212314b3..fe986af884f8 100644 --- a/drivers/s390/net/ctcmain.c +++ b/drivers/s390/net/ctcmain.c @@ -1486,13 +1486,13 @@ ch_action_iofatal(fsm_instance * fi, int event, void *arg) } } -static void +static void ch_action_reinit(fsm_instance *fi, int event, void *arg) { struct channel *ch = (struct channel *)arg; struct net_device *dev = ch->netdev; struct ctc_priv *privptr = dev->priv; - + DBF_TEXT(trace, 4, __FUNCTION__); ch_action_iofatal(fi, event, arg); fsm_addtimer(&privptr->restart_timer, 1000, DEV_EVENT_RESTART, dev); @@ -1624,7 +1624,7 @@ less_than(char *id1, char *id2) } dev1 = simple_strtoul(id1, &id1, 16); dev2 = simple_strtoul(id2, &id2, 16); - + return (dev1 < dev2); } @@ -1895,7 +1895,7 @@ ctc_irq_handler(struct ccw_device *cdev, unsigned long intparm, struct irb *irb) irb->scsw.dstat); return; } - + priv = ((struct ccwgroup_device *)cdev->dev.driver_data) ->dev.driver_data; @@ -1909,7 +1909,7 @@ ctc_irq_handler(struct ccw_device *cdev, unsigned long intparm, struct irb *irb) "device %s\n", cdev->dev.bus_id); return; } - + dev = (struct net_device *) (ch->netdev); if (dev == NULL) { ctc_pr_crit("ctc: ctc_irq_handler dev=NULL bus_id=%s, ch=0x%p\n", @@ -2008,12 +2008,12 @@ dev_action_stop(fsm_instance * fi, int event, void *arg) fsm_event(ch->fsm, CH_EVENT_STOP, ch); } } -static void +static void dev_action_restart(fsm_instance *fi, int event, void *arg) { struct net_device *dev = (struct net_device *)arg; struct ctc_priv *privptr = dev->priv; - + DBF_TEXT(trace, 3, __FUNCTION__); ctc_pr_debug("%s: Restarting\n", dev->name); dev_action_stop(fi, event, arg); @@ -2193,7 +2193,7 @@ transmit_skb(struct channel *ch, struct sk_buff *skb) DBF_TEXT(trace, 5, __FUNCTION__); /* we need to acquire the lock for testing the state - * otherwise we can have an IRQ changing the state to + * otherwise we can have an IRQ changing the state to * TXIDLE after the test but before acquiring the lock. */ spin_lock_irqsave(&ch->collect_lock, saveflags); @@ -2393,7 +2393,7 @@ ctc_tx(struct sk_buff *skb, struct net_device * dev) /** * If channels are not running, try to restart them - * and throw away packet. + * and throw away packet. */ if (fsm_getstate(privptr->fsm) != DEV_STATE_RUNNING) { fsm_event(privptr->fsm, DEV_EVENT_START, dev); @@ -2738,7 +2738,7 @@ ctc_remove_files(struct device *dev) /** * Add ctc specific attributes. * Add ctc private data. - * + * * @param cgdev pointer to ccwgroup_device just added * * @returns 0 on success, !0 on failure. @@ -2869,7 +2869,7 @@ ctc_new_device(struct ccwgroup_device *cgdev) DBF_TEXT(setup, 3, buffer); type = get_channel_type(&cgdev->cdev[0]->id); - + snprintf(read_id, CTC_ID_SIZE, "ch-%s", cgdev->cdev[0]->dev.bus_id); snprintf(write_id, CTC_ID_SIZE, "ch-%s", cgdev->cdev[1]->dev.bus_id); @@ -2907,7 +2907,7 @@ ctc_new_device(struct ccwgroup_device *cgdev) channel_get(type, direction == READ ? read_id : write_id, direction); if (privptr->channel[direction] == NULL) { - if (direction == WRITE) + if (direction == WRITE) channel_free(privptr->channel[READ]); ctc_free_netdevice(dev, 1); @@ -2955,7 +2955,7 @@ ctc_shutdown_device(struct ccwgroup_device *cgdev) { struct ctc_priv *priv; struct net_device *ndev; - + DBF_TEXT(setup, 3, __FUNCTION__); pr_debug("%s() called\n", __FUNCTION__); diff --git a/drivers/s390/net/ctctty.c b/drivers/s390/net/ctctty.c index 5cdcdbf92962..af54d1de07bf 100644 --- a/drivers/s390/net/ctctty.c +++ b/drivers/s390/net/ctctty.c @@ -130,7 +130,7 @@ ctc_tty_readmodem(ctc_tty_info *info) if ((tty = info->tty)) { if (info->mcr & UART_MCR_RTS) { struct sk_buff *skb; - + if ((skb = skb_dequeue(&info->rx_queue))) { int len = skb->len; tty_insert_flip_string(tty, skb->data, len); @@ -328,7 +328,7 @@ ctc_tty_inject(ctc_tty_info *info, char c) { int skb_res; struct sk_buff *skb; - + DBF_TEXT(trace, 4, __FUNCTION__); if (ctc_tty_shuttingdown) return; @@ -497,7 +497,7 @@ ctc_tty_write(struct tty_struct *tty, const u_char * buf, int count) c = (count < CTC_TTY_XMIT_SIZE) ? count : CTC_TTY_XMIT_SIZE; if (c <= 0) break; - + skb_res = info->netdev->hard_header_len + sizeof(info->mcr) + + sizeof(__u32); skb = dev_alloc_skb(skb_res + c); @@ -828,7 +828,7 @@ ctc_tty_block_til_ready(struct tty_struct *tty, struct file *filp, ctc_tty_info if (tty_hung_up_p(filp) || (info->flags & CTC_ASYNC_CLOSING)) { if (info->flags & CTC_ASYNC_CLOSING) - wait_event(info->close_wait, + wait_event(info->close_wait, !(info->flags & CTC_ASYNC_CLOSING)); #ifdef MODEM_DO_RESTART if (info->flags & CTC_ASYNC_HUP_NOTIFY) @@ -1247,7 +1247,7 @@ ctc_tty_unregister_netdev(struct net_device *dev) { void ctc_tty_cleanup(void) { unsigned long saveflags; - + DBF_TEXT(trace, 2, __FUNCTION__); spin_lock_irqsave(&ctc_tty_lock, saveflags); ctc_tty_shuttingdown = 1; diff --git a/drivers/s390/net/cu3088.c b/drivers/s390/net/cu3088.c index e1b8c9a9634f..e965f03a7291 100644 --- a/drivers/s390/net/cu3088.c +++ b/drivers/s390/net/cu3088.c @@ -20,7 +20,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ - + #include #include #include @@ -94,7 +94,7 @@ static DRIVER_ATTR(group, 0200, NULL, group_write); /* Register-unregister for ctc&lcs */ int -register_cu3088_discipline(struct ccwgroup_driver *dcp) +register_cu3088_discipline(struct ccwgroup_driver *dcp) { int rc; @@ -109,7 +109,7 @@ register_cu3088_discipline(struct ccwgroup_driver *dcp) rc = driver_create_file(&dcp->driver, &driver_attr_group); if (rc) ccwgroup_driver_unregister(dcp); - + return rc; } @@ -137,7 +137,7 @@ static int __init cu3088_init (void) { int rc; - + cu3088_root_dev = s390_root_dev_register("cu3088"); if (IS_ERR(cu3088_root_dev)) return PTR_ERR(cu3088_root_dev); diff --git a/drivers/s390/net/iucv.c b/drivers/s390/net/iucv.c index 6190be9dca99..e0c7deb98831 100644 --- a/drivers/s390/net/iucv.c +++ b/drivers/s390/net/iucv.c @@ -1,4 +1,4 @@ -/* +/* * IUCV network driver * * Copyright (C) 2001 IBM Deutschland Entwicklung GmbH, IBM Corporation @@ -28,7 +28,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ - + /* #define DEBUG */ #include @@ -81,7 +81,7 @@ iucv_bus_match (struct device *dev, struct device_driver *drv) struct bus_type iucv_bus = { .name = "iucv", .match = iucv_bus_match, -}; +}; struct device *iucv_root; @@ -297,7 +297,7 @@ MODULE_LICENSE("GPL"); /* * Debugging stuff *******************************************************************************/ - + #ifdef DEBUG static int debuglevel = 0; @@ -344,7 +344,7 @@ do { \ /* * Internal functions *******************************************************************************/ - + /** * print start banner */ @@ -810,7 +810,7 @@ iucv_register_program (__u8 pgmname[16], sizeof (new_handler->id.userid)); EBC_TOUPPER (new_handler->id.userid, sizeof (new_handler->id.userid)); - + if (pgmmask) { memcpy (new_handler->id.mask, pgmmask, sizeof (new_handler->id.mask)); @@ -1229,7 +1229,7 @@ iucv_purge (__u16 pathid, __u32 msgid, __u32 srccls, __u32 *audit) /* parm->ipaudit has only 3 bytes */ *audit >>= 8; } - + release_param(parm); iucv_debug(1, "b2f0_result = %ld", b2f0_result); @@ -2330,14 +2330,14 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf) temp_buff1[j] &= (h->id.mask)[j]; temp_buff2[j] &= (h->id.mask)[j]; } - + iucv_dumpit("temp_buff1:", temp_buff1, sizeof(temp_buff1)); iucv_dumpit("temp_buff2", temp_buff2, sizeof(temp_buff2)); - + if (!memcmp (temp_buff1, temp_buff2, 24)) { - + iucv_debug(2, "found a matching handler"); break; @@ -2368,7 +2368,7 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf) } else iucv_sever(int_buf->ippathid, no_listener); break; - + case 0x02: /*connection complete */ if (messagesDisabled) { iucv_setmask(~0); @@ -2387,7 +2387,7 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf) } else iucv_sever(int_buf->ippathid, no_listener); break; - + case 0x03: /* connection severed */ if (messagesDisabled) { iucv_setmask(~0); @@ -2398,13 +2398,13 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf) interrupt->ConnectionSevered( (iucv_ConnectionSevered *)int_buf, h->pgm_data); - + else iucv_sever (int_buf->ippathid, no_listener); } else iucv_sever(int_buf->ippathid, no_listener); break; - + case 0x04: /* connection quiesced */ if (messagesDisabled) { iucv_setmask(~0); @@ -2420,7 +2420,7 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf) "ConnectionQuiesced not called"); } break; - + case 0x05: /* connection resumed */ if (messagesDisabled) { iucv_setmask(~0); @@ -2436,7 +2436,7 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf) "ConnectionResumed not called"); } break; - + case 0x06: /* priority message complete */ case 0x07: /* nonpriority message complete */ if (h) { @@ -2449,7 +2449,7 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf) "MessageComplete not called"); } break; - + case 0x08: /* priority message pending */ case 0x09: /* nonpriority message pending */ if (h) { @@ -2467,7 +2467,7 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf) __FUNCTION__); break; } /* end switch */ - + iucv_debug(2, "exiting pathid %d, type %02X", int_buf->ippathid, int_buf->iptype); diff --git a/drivers/s390/net/iucv.h b/drivers/s390/net/iucv.h index 0c4644d3d2f3..5b6b1b7241c9 100644 --- a/drivers/s390/net/iucv.h +++ b/drivers/s390/net/iucv.h @@ -4,7 +4,7 @@ * * S390 version * Copyright (C) 2000 IBM Corporation - * Author(s):Alan Altmark (Alan_Altmark@us.ibm.com) + * Author(s):Alan Altmark (Alan_Altmark@us.ibm.com) * Xenia Tkatschow (xenia@us.ibm.com) * * @@ -16,17 +16,17 @@ * CP Programming Services book, also available on the web * thru www.ibm.com/s390/vm/pubs, manual # SC24-5760 * - * Definition of Return Codes - * -All positive return codes including zero are reflected back - * from CP except for iucv_register_program. The definition of each - * return code can be found in CP Programming Services book. - * Also available on the web thru www.ibm.com/s390/vm/pubs, manual # SC24-5760 - * - Return Code of: - * (-EINVAL) Invalid value - * (-ENOMEM) storage allocation failed + * Definition of Return Codes + * -All positive return codes including zero are reflected back + * from CP except for iucv_register_program. The definition of each + * return code can be found in CP Programming Services book. + * Also available on the web thru www.ibm.com/s390/vm/pubs, manual # SC24-5760 + * - Return Code of: + * (-EINVAL) Invalid value + * (-ENOMEM) storage allocation failed * pgmask defined in iucv_register_program will be set depending on input - * paramters. - * + * paramters. + * */ #include @@ -124,13 +124,13 @@ iucv_hex_dump(unsigned char *buf, size_t len) #define iucv_handle_t void * /* flags1: - * All flags are defined in the field IPFLAGS1 of each function - * and can be found in CP Programming Services. - * IPLOCAL - Indicates the connect can only be satisfied on the - * local system - * IPPRTY - Indicates a priority message - * IPQUSCE - Indicates you do not want to receive messages on a - * path until an iucv_resume is issued + * All flags are defined in the field IPFLAGS1 of each function + * and can be found in CP Programming Services. + * IPLOCAL - Indicates the connect can only be satisfied on the + * local system + * IPPRTY - Indicates a priority message + * IPQUSCE - Indicates you do not want to receive messages on a + * path until an iucv_resume is issued * IPRMDATA - Indicates that the message is in the parameter list */ #define IPLOCAL 0x01 @@ -154,14 +154,14 @@ iucv_hex_dump(unsigned char *buf, size_t len) #define AllInterrupts 0xf8 /* * Mapping of external interrupt buffers should be used with the corresponding - * interrupt types. - * Names: iucv_ConnectionPending -> connection pending + * interrupt types. + * Names: iucv_ConnectionPending -> connection pending * iucv_ConnectionComplete -> connection complete - * iucv_ConnectionSevered -> connection severed - * iucv_ConnectionQuiesced -> connection quiesced - * iucv_ConnectionResumed -> connection resumed - * iucv_MessagePending -> message pending - * iucv_MessageComplete -> message complete + * iucv_ConnectionSevered -> connection severed + * iucv_ConnectionQuiesced -> connection quiesced + * iucv_ConnectionResumed -> connection resumed + * iucv_MessagePending -> message pending + * iucv_MessageComplete -> message complete */ typedef struct { u16 ippathid; @@ -260,16 +260,16 @@ typedef struct { uchar res2[3]; } iucv_MessageComplete; -/* - * iucv_interrupt_ops_t: Is a vector of functions that handle - * IUCV interrupts. - * Parameter list: - * eib - is a pointer to a 40-byte area described - * with one of the structures above. - * pgm_data - this data is strictly for the - * interrupt handler that is passed by - * the application. This may be an address - * or token. +/* + * iucv_interrupt_ops_t: Is a vector of functions that handle + * IUCV interrupts. + * Parameter list: + * eib - is a pointer to a 40-byte area described + * with one of the structures above. + * pgm_data - this data is strictly for the + * interrupt handler that is passed by + * the application. This may be an address + * or token. */ typedef struct { void (*ConnectionPending) (iucv_ConnectionPending * eib, @@ -287,8 +287,8 @@ typedef struct { } iucv_interrupt_ops_t; /* - *iucv_array_t : Defines buffer array. - * Inside the array may be 31- bit addresses and 31-bit lengths. + *iucv_array_t : Defines buffer array. + * Inside the array may be 31- bit addresses and 31-bit lengths. */ typedef struct { u32 address; @@ -299,19 +299,19 @@ extern struct bus_type iucv_bus; extern struct device *iucv_root; /* -prototypes- */ -/* - * Name: iucv_register_program - * Purpose: Registers an application with IUCV - * Input: prmname - user identification +/* + * Name: iucv_register_program + * Purpose: Registers an application with IUCV + * Input: prmname - user identification * userid - machine identification * pgmmask - indicates which bits in the prmname and userid combined will be * used to determine who is given control - * ops - address of vector of interrupt handlers - * pgm_data- application data passed to interrupt handlers - * Output: NA - * Return: address of handler + * ops - address of vector of interrupt handlers + * pgm_data- application data passed to interrupt handlers + * Output: NA + * Return: address of handler * (0) - Error occurred, registration not completed. - * NOTE: Exact cause of failure will be recorded in syslog. + * NOTE: Exact cause of failure will be recorded in syslog. */ iucv_handle_t iucv_register_program (uchar pgmname[16], uchar userid[8], @@ -319,13 +319,13 @@ iucv_handle_t iucv_register_program (uchar pgmname[16], iucv_interrupt_ops_t * ops, void *pgm_data); -/* - * Name: iucv_unregister_program - * Purpose: Unregister application with IUCV - * Input: address of handler - * Output: NA - * Return: (0) - Normal return - * (-EINVAL) - Internal error, wild pointer +/* + * Name: iucv_unregister_program + * Purpose: Unregister application with IUCV + * Input: address of handler + * Output: NA + * Return: (0) - Normal return + * (-EINVAL) - Internal error, wild pointer */ int iucv_unregister_program (iucv_handle_t handle); @@ -333,7 +333,7 @@ int iucv_unregister_program (iucv_handle_t handle); * Name: iucv_accept * Purpose: This function is issued after the user receives a Connection Pending external * interrupt and now wishes to complete the IUCV communication path. - * Input: pathid - u16 , Path identification number + * Input: pathid - u16 , Path identification number * msglim_reqstd - u16, The number of outstanding messages requested. * user_data - uchar[16], Data specified by the iucv_connect function. * flags1 - int, Contains options for this path. @@ -358,34 +358,34 @@ int iucv_accept (u16 pathid, void *pgm_data, int *flags1_out, u16 * msglim); /* - * Name: iucv_connect + * Name: iucv_connect * Purpose: This function establishes an IUCV path. Although the connect may complete - * successfully, you are not able to use the path until you receive an IUCV - * Connection Complete external interrupt. - * Input: pathid - u16 *, Path identification number - * msglim_reqstd - u16, Number of outstanding messages requested - * user_data - uchar[16], 16-byte user data + * successfully, you are not able to use the path until you receive an IUCV + * Connection Complete external interrupt. + * Input: pathid - u16 *, Path identification number + * msglim_reqstd - u16, Number of outstanding messages requested + * user_data - uchar[16], 16-byte user data * userid - uchar[8], User identification - * system_name - uchar[8], 8-byte identifying the system name + * system_name - uchar[8], 8-byte identifying the system name * flags1 - int, Contains options for this path. * -IPPRTY - 0x20, Specifies if you want to send priority message. * -IPRMDATA - 0x80, Specifies whether your program can handle a message * in the parameter list. - * -IPQUSCE - 0x40, Specifies whether you want to quiesce the path being + * -IPQUSCE - 0x40, Specifies whether you want to quiesce the path being * established. - * -IPLOCAL - 0X01, Allows an application to force the partner to be on + * -IPLOCAL - 0X01, Allows an application to force the partner to be on * the local system. If local is specified then target class cannot be - * specified. + * specified. * flags1_out - int * Contains information about the path * - IPPRTY - 0x20, Indicates you may send priority messages. * msglim - * u16, Number of outstanding messages - * handle - iucv_handle_t, Address of handler - * pgm_data - void *, Application data passed to interrupt handlers + * handle - iucv_handle_t, Address of handler + * pgm_data - void *, Application data passed to interrupt handlers * Output: return code from CP IUCV call * rc - return code from iucv_declare_buffer - * -EINVAL - Invalid handle passed by application - * -EINVAL - Pathid address is NULL - * add_pathid_result - Return code from internal function add_pathid + * -EINVAL - Invalid handle passed by application + * -EINVAL - Pathid address is NULL + * add_pathid_result - Return code from internal function add_pathid */ int iucv_connect (u16 * pathid, @@ -397,16 +397,16 @@ int int *flags1_out, u16 * msglim, iucv_handle_t handle, void *pgm_data); -/* - * Name: iucv_purge - * Purpose: This function cancels a message that you have sent. - * Input: pathid - Path identification number. +/* + * Name: iucv_purge + * Purpose: This function cancels a message that you have sent. + * Input: pathid - Path identification number. * msgid - Specifies the message ID of the message to be purged. - * srccls - Specifies the source message class. - * Output: audit - Contains information about asynchronous error - * that may have affected the normal completion - * of this message. - * Return: Return code from CP IUCV call. + * srccls - Specifies the source message class. + * Output: audit - Contains information about asynchronous error + * that may have affected the normal completion + * of this message. + * Return: Return code from CP IUCV call. */ int iucv_purge (u16 pathid, u32 msgid, u32 srccls, __u32 *audit); /* @@ -426,38 +426,38 @@ ulong iucv_query_maxconn (void); */ ulong iucv_query_bufsize (void); -/* - * Name: iucv_quiesce - * Purpose: This function temporarily suspends incoming messages on an - * IUCV path. You can later reactivate the path by invoking - * the iucv_resume function. - * Input: pathid - Path identification number - * user_data - 16-bytes of user data - * Output: NA - * Return: Return code from CP IUCV call. +/* + * Name: iucv_quiesce + * Purpose: This function temporarily suspends incoming messages on an + * IUCV path. You can later reactivate the path by invoking + * the iucv_resume function. + * Input: pathid - Path identification number + * user_data - 16-bytes of user data + * Output: NA + * Return: Return code from CP IUCV call. */ int iucv_quiesce (u16 pathid, uchar user_data[16]); -/* - * Name: iucv_receive - * Purpose: This function receives messages that are being sent to you +/* + * Name: iucv_receive + * Purpose: This function receives messages that are being sent to you * over established paths. Data will be returned in buffer for length of * buflen. - * Input: - * pathid - Path identification number. - * buffer - Address of buffer to receive. - * buflen - Length of buffer to receive. - * msgid - Specifies the message ID. - * trgcls - Specifies target class. - * Output: + * Input: + * pathid - Path identification number. + * buffer - Address of buffer to receive. + * buflen - Length of buffer to receive. + * msgid - Specifies the message ID. + * trgcls - Specifies target class. + * Output: * flags1_out: int *, Contains information about this path. * IPNORPY - 0x10 Specifies this is a one-way message and no reply is - * expected. - * IPPRTY - 0x20 Specifies if you want to send priority message. + * expected. + * IPPRTY - 0x20 Specifies if you want to send priority message. * IPRMDATA - 0x80 specifies the data is contained in the parameter list * residual_buffer - address of buffer updated by the number * of bytes you have received. - * residual_length - + * residual_length - * Contains one of the following values, if the receive buffer is: * The same length as the message, this field is zero. * Longer than the message, this field contains the number of @@ -466,8 +466,8 @@ int iucv_quiesce (u16 pathid, uchar user_data[16]); * count (that is, the number of bytes remaining in the * message that does not fit into the buffer. In this * case b2f0_result = 5. - * Return: Return code from CP IUCV call. - * (-EINVAL) - buffer address is pointing to NULL + * Return: Return code from CP IUCV call. + * (-EINVAL) - buffer address is pointing to NULL */ int iucv_receive (u16 pathid, u32 msgid, @@ -477,16 +477,16 @@ int iucv_receive (u16 pathid, int *flags1_out, ulong * residual_buffer, ulong * residual_length); - /* - * Name: iucv_receive_array - * Purpose: This function receives messages that are being sent to you + /* + * Name: iucv_receive_array + * Purpose: This function receives messages that are being sent to you * over established paths. Data will be returned in first buffer for * length of first buffer. - * Input: pathid - Path identification number. + * Input: pathid - Path identification number. * msgid - specifies the message ID. * trgcls - Specifies target class. - * buffer - Address of array of buffers. - * buflen - Total length of buffers. + * buffer - Address of array of buffers. + * buflen - Total length of buffers. * Output: * flags1_out: int *, Contains information about this path. * IPNORPY - 0x10 Specifies this is a one-way message and no reply is @@ -504,8 +504,8 @@ int iucv_receive (u16 pathid, * count (that is, the number of bytes remaining in the * message that does not fit into the buffer. In this * case b2f0_result = 5. - * Return: Return code from CP IUCV call. - * (-EINVAL) - Buffer address is NULL. + * Return: Return code from CP IUCV call. + * (-EINVAL) - Buffer address is NULL. */ int iucv_receive_array (u16 pathid, u32 msgid, @@ -515,44 +515,44 @@ int iucv_receive_array (u16 pathid, int *flags1_out, ulong * residual_buffer, ulong * residual_length); -/* - * Name: iucv_reject - * Purpose: The reject function refuses a specified message. Between the - * time you are notified of a message and the time that you - * complete the message, the message may be rejected. - * Input: pathid - Path identification number. - * msgid - Specifies the message ID. - * trgcls - Specifies target class. - * Output: NA - * Return: Return code from CP IUCV call. +/* + * Name: iucv_reject + * Purpose: The reject function refuses a specified message. Between the + * time you are notified of a message and the time that you + * complete the message, the message may be rejected. + * Input: pathid - Path identification number. + * msgid - Specifies the message ID. + * trgcls - Specifies target class. + * Output: NA + * Return: Return code from CP IUCV call. */ int iucv_reject (u16 pathid, u32 msgid, u32 trgcls); -/* - * Name: iucv_reply - * Purpose: This function responds to the two-way messages that you - * receive. You must identify completely the message to - * which you wish to reply. ie, pathid, msgid, and trgcls. - * Input: pathid - Path identification number. - * msgid - Specifies the message ID. - * trgcls - Specifies target class. +/* + * Name: iucv_reply + * Purpose: This function responds to the two-way messages that you + * receive. You must identify completely the message to + * which you wish to reply. ie, pathid, msgid, and trgcls. + * Input: pathid - Path identification number. + * msgid - Specifies the message ID. + * trgcls - Specifies target class. * flags1 - Option for path. - * IPPRTY- 0x20, Specifies if you want to send priority message. - * buffer - Address of reply buffer. - * buflen - Length of reply buffer. - * Output: residual_buffer - Address of buffer updated by the number - * of bytes you have moved. + * IPPRTY- 0x20, Specifies if you want to send priority message. + * buffer - Address of reply buffer. + * buflen - Length of reply buffer. + * Output: residual_buffer - Address of buffer updated by the number + * of bytes you have moved. * residual_length - Contains one of the following values: * If the answer buffer is the same length as the reply, this field * contains zero. * If the answer buffer is longer than the reply, this field contains - * the number of bytes remaining in the buffer. + * the number of bytes remaining in the buffer. * If the answer buffer is shorter than the reply, this field contains * a residual count (that is, the number of bytes remianing in the * reply that does not fit into the buffer. In this * case b2f0_result = 5. - * Return: Return code from CP IUCV call. - * (-EINVAL) - Buffer address is NULL. + * Return: Return code from CP IUCV call. + * (-EINVAL) - Buffer address is NULL. */ int iucv_reply (u16 pathid, u32 msgid, @@ -561,20 +561,20 @@ int iucv_reply (u16 pathid, void *buffer, ulong buflen, ulong * residual_buffer, ulong * residual_length); -/* - * Name: iucv_reply_array - * Purpose: This function responds to the two-way messages that you - * receive. You must identify completely the message to - * which you wish to reply. ie, pathid, msgid, and trgcls. - * The array identifies a list of addresses and lengths of - * discontiguous buffers that contains the reply data. - * Input: pathid - Path identification number - * msgid - Specifies the message ID. - * trgcls - Specifies target class. +/* + * Name: iucv_reply_array + * Purpose: This function responds to the two-way messages that you + * receive. You must identify completely the message to + * which you wish to reply. ie, pathid, msgid, and trgcls. + * The array identifies a list of addresses and lengths of + * discontiguous buffers that contains the reply data. + * Input: pathid - Path identification number + * msgid - Specifies the message ID. + * trgcls - Specifies target class. * flags1 - Option for path. * IPPRTY- 0x20, Specifies if you want to send priority message. - * buffer - Address of array of reply buffers. - * buflen - Total length of reply buffers. + * buffer - Address of array of reply buffers. + * buflen - Total length of reply buffers. * Output: residual_buffer - Address of buffer which IUCV is currently working on. * residual_length - Contains one of the following values: * If the answer buffer is the same length as the reply, this field @@ -585,8 +585,8 @@ int iucv_reply (u16 pathid, * a residual count (that is, the number of bytes remianing in the * reply that does not fit into the buffer. In this * case b2f0_result = 5. - * Return: Return code from CP IUCV call. - * (-EINVAL) - Buffer address is NULL. + * Return: Return code from CP IUCV call. + * (-EINVAL) - Buffer address is NULL. */ int iucv_reply_array (u16 pathid, u32 msgid, @@ -596,77 +596,77 @@ int iucv_reply_array (u16 pathid, ulong buflen, ulong * residual_address, ulong * residual_length); -/* - * Name: iucv_reply_prmmsg - * Purpose: This function responds to the two-way messages that you - * receive. You must identify completely the message to - * which you wish to reply. ie, pathid, msgid, and trgcls. - * Prmmsg signifies the data is moved into the - * parameter list. - * Input: pathid - Path identification number. - * msgid - Specifies the message ID. - * trgcls - Specifies target class. +/* + * Name: iucv_reply_prmmsg + * Purpose: This function responds to the two-way messages that you + * receive. You must identify completely the message to + * which you wish to reply. ie, pathid, msgid, and trgcls. + * Prmmsg signifies the data is moved into the + * parameter list. + * Input: pathid - Path identification number. + * msgid - Specifies the message ID. + * trgcls - Specifies target class. * flags1 - Option for path. * IPPRTY- 0x20 Specifies if you want to send priority message. - * prmmsg - 8-bytes of data to be placed into the parameter. - * list. - * Output: NA - * Return: Return code from CP IUCV call. + * prmmsg - 8-bytes of data to be placed into the parameter. + * list. + * Output: NA + * Return: Return code from CP IUCV call. */ int iucv_reply_prmmsg (u16 pathid, u32 msgid, u32 trgcls, int flags1, uchar prmmsg[8]); -/* - * Name: iucv_resume - * Purpose: This function restores communications over a quiesced path - * Input: pathid - Path identification number. - * user_data - 16-bytes of user data. - * Output: NA - * Return: Return code from CP IUCV call. +/* + * Name: iucv_resume + * Purpose: This function restores communications over a quiesced path + * Input: pathid - Path identification number. + * user_data - 16-bytes of user data. + * Output: NA + * Return: Return code from CP IUCV call. */ int iucv_resume (u16 pathid, uchar user_data[16]); -/* - * Name: iucv_send - * Purpose: This function transmits data to another application. - * Data to be transmitted is in a buffer and this is a - * one-way message and the receiver will not reply to the - * message. - * Input: pathid - Path identification number. - * trgcls - Specifies target class. - * srccls - Specifies the source message class. - * msgtag - Specifies a tag to be associated with the message. +/* + * Name: iucv_send + * Purpose: This function transmits data to another application. + * Data to be transmitted is in a buffer and this is a + * one-way message and the receiver will not reply to the + * message. + * Input: pathid - Path identification number. + * trgcls - Specifies target class. + * srccls - Specifies the source message class. + * msgtag - Specifies a tag to be associated with the message. * flags1 - Option for path. * IPPRTY- 0x20 Specifies if you want to send priority message. - * buffer - Address of send buffer. - * buflen - Length of send buffer. - * Output: msgid - Specifies the message ID. - * Return: Return code from CP IUCV call. - * (-EINVAL) - Buffer address is NULL. + * buffer - Address of send buffer. + * buflen - Length of send buffer. + * Output: msgid - Specifies the message ID. + * Return: Return code from CP IUCV call. + * (-EINVAL) - Buffer address is NULL. */ int iucv_send (u16 pathid, u32 * msgid, u32 trgcls, u32 srccls, u32 msgtag, int flags1, void *buffer, ulong buflen); -/* - * Name: iucv_send_array - * Purpose: This function transmits data to another application. - * The contents of buffer is the address of the array of - * addresses and lengths of discontiguous buffers that hold - * the message text. This is a one-way message and the - * receiver will not reply to the message. - * Input: pathid - Path identification number. - * trgcls - Specifies target class. - * srccls - Specifies the source message class. +/* + * Name: iucv_send_array + * Purpose: This function transmits data to another application. + * The contents of buffer is the address of the array of + * addresses and lengths of discontiguous buffers that hold + * the message text. This is a one-way message and the + * receiver will not reply to the message. + * Input: pathid - Path identification number. + * trgcls - Specifies target class. + * srccls - Specifies the source message class. * msgtag - Specifies a tag to be associated witht the message. * flags1 - Option for path. - * IPPRTY- specifies if you want to send priority message. - * buffer - Address of array of send buffers. - * buflen - Total length of send buffers. - * Output: msgid - Specifies the message ID. - * Return: Return code from CP IUCV call. - * (-EINVAL) - Buffer address is NULL. + * IPPRTY- specifies if you want to send priority message. + * buffer - Address of array of send buffers. + * buflen - Total length of send buffers. + * Output: msgid - Specifies the message ID. + * Return: Return code from CP IUCV call. + * (-EINVAL) - Buffer address is NULL. */ int iucv_send_array (u16 pathid, u32 * msgid, @@ -675,48 +675,48 @@ int iucv_send_array (u16 pathid, u32 msgtag, int flags1, iucv_array_t * buffer, ulong buflen); -/* - * Name: iucv_send_prmmsg - * Purpose: This function transmits data to another application. - * Prmmsg specifies that the 8-bytes of data are to be moved - * into the parameter list. This is a one-way message and the - * receiver will not reply to the message. - * Input: pathid - Path identification number. - * trgcls - Specifies target class. - * srccls - Specifies the source message class. - * msgtag - Specifies a tag to be associated with the message. +/* + * Name: iucv_send_prmmsg + * Purpose: This function transmits data to another application. + * Prmmsg specifies that the 8-bytes of data are to be moved + * into the parameter list. This is a one-way message and the + * receiver will not reply to the message. + * Input: pathid - Path identification number. + * trgcls - Specifies target class. + * srccls - Specifies the source message class. + * msgtag - Specifies a tag to be associated with the message. * flags1 - Option for path. * IPPRTY- 0x20 specifies if you want to send priority message. - * prmmsg - 8-bytes of data to be placed into parameter list. - * Output: msgid - Specifies the message ID. - * Return: Return code from CP IUCV call. + * prmmsg - 8-bytes of data to be placed into parameter list. + * Output: msgid - Specifies the message ID. + * Return: Return code from CP IUCV call. */ int iucv_send_prmmsg (u16 pathid, u32 * msgid, u32 trgcls, u32 srccls, u32 msgtag, int flags1, uchar prmmsg[8]); -/* - * Name: iucv_send2way - * Purpose: This function transmits data to another application. - * Data to be transmitted is in a buffer. The receiver - * of the send is expected to reply to the message and - * a buffer is provided into which IUCV moves the reply - * to this message. - * Input: pathid - Path identification number. - * trgcls - Specifies target class. - * srccls - Specifies the source message class. - * msgtag - Specifies a tag associated with the message. +/* + * Name: iucv_send2way + * Purpose: This function transmits data to another application. + * Data to be transmitted is in a buffer. The receiver + * of the send is expected to reply to the message and + * a buffer is provided into which IUCV moves the reply + * to this message. + * Input: pathid - Path identification number. + * trgcls - Specifies target class. + * srccls - Specifies the source message class. + * msgtag - Specifies a tag associated with the message. * flags1 - Option for path. * IPPRTY- 0x20 Specifies if you want to send priority message. - * buffer - Address of send buffer. - * buflen - Length of send buffer. - * ansbuf - Address of buffer into which IUCV moves the reply of - * this message. - * anslen - Address of length of buffer. - * Output: msgid - Specifies the message ID. - * Return: Return code from CP IUCV call. - * (-EINVAL) - Buffer or ansbuf address is NULL. + * buffer - Address of send buffer. + * buflen - Length of send buffer. + * ansbuf - Address of buffer into which IUCV moves the reply of + * this message. + * anslen - Address of length of buffer. + * Output: msgid - Specifies the message ID. + * Return: Return code from CP IUCV call. + * (-EINVAL) - Buffer or ansbuf address is NULL. */ int iucv_send2way (u16 pathid, u32 * msgid, @@ -726,28 +726,28 @@ int iucv_send2way (u16 pathid, int flags1, void *buffer, ulong buflen, void *ansbuf, ulong anslen); -/* - * Name: iucv_send2way_array - * Purpose: This function transmits data to another application. - * The contents of buffer is the address of the array of - * addresses and lengths of discontiguous buffers that hold - * the message text. The receiver of the send is expected to - * reply to the message and a buffer is provided into which - * IUCV moves the reply to this message. - * Input: pathid - Path identification number. - * trgcls - Specifies target class. - * srccls - Specifies the source message class. - * msgtag - Specifies a tag to be associated with the message. +/* + * Name: iucv_send2way_array + * Purpose: This function transmits data to another application. + * The contents of buffer is the address of the array of + * addresses and lengths of discontiguous buffers that hold + * the message text. The receiver of the send is expected to + * reply to the message and a buffer is provided into which + * IUCV moves the reply to this message. + * Input: pathid - Path identification number. + * trgcls - Specifies target class. + * srccls - Specifies the source message class. + * msgtag - Specifies a tag to be associated with the message. * flags1 - Option for path. * IPPRTY- 0x20 Specifies if you want to send priority message. - * buffer - Sddress of array of send buffers. - * buflen - Total length of send buffers. - * ansbuf - Address of array of buffer into which IUCV moves the reply - * of this message. - * anslen - Address of length reply buffers. - * Output: msgid - Specifies the message ID. - * Return: Return code from CP IUCV call. - * (-EINVAL) - Buffer address is NULL. + * buffer - Sddress of array of send buffers. + * buflen - Total length of send buffers. + * ansbuf - Address of array of buffer into which IUCV moves the reply + * of this message. + * anslen - Address of length reply buffers. + * Output: msgid - Specifies the message ID. + * Return: Return code from CP IUCV call. + * (-EINVAL) - Buffer address is NULL. */ int iucv_send2way_array (u16 pathid, u32 * msgid, @@ -758,27 +758,27 @@ int iucv_send2way_array (u16 pathid, iucv_array_t * buffer, ulong buflen, iucv_array_t * ansbuf, ulong anslen); -/* - * Name: iucv_send2way_prmmsg - * Purpose: This function transmits data to another application. - * Prmmsg specifies that the 8-bytes of data are to be moved - * into the parameter list. This is a two-way message and the - * receiver of the message is expected to reply. A buffer - * is provided into which IUCV moves the reply to this - * message. - * Input: pathid - Rath identification number. - * trgcls - Specifies target class. - * srccls - Specifies the source message class. - * msgtag - Specifies a tag to be associated with the message. +/* + * Name: iucv_send2way_prmmsg + * Purpose: This function transmits data to another application. + * Prmmsg specifies that the 8-bytes of data are to be moved + * into the parameter list. This is a two-way message and the + * receiver of the message is expected to reply. A buffer + * is provided into which IUCV moves the reply to this + * message. + * Input: pathid - Rath identification number. + * trgcls - Specifies target class. + * srccls - Specifies the source message class. + * msgtag - Specifies a tag to be associated with the message. * flags1 - Option for path. * IPPRTY- 0x20 Specifies if you want to send priority message. - * prmmsg - 8-bytes of data to be placed in parameter list. - * ansbuf - Address of buffer into which IUCV moves the reply of + * prmmsg - 8-bytes of data to be placed in parameter list. + * ansbuf - Address of buffer into which IUCV moves the reply of * this message. - * anslen - Address of length of buffer. - * Output: msgid - Specifies the message ID. - * Return: Return code from CP IUCV call. - * (-EINVAL) - Buffer address is NULL. + * anslen - Address of length of buffer. + * Output: msgid - Specifies the message ID. + * Return: Return code from CP IUCV call. + * (-EINVAL) - Buffer address is NULL. */ int iucv_send2way_prmmsg (u16 pathid, u32 * msgid, @@ -788,29 +788,29 @@ int iucv_send2way_prmmsg (u16 pathid, ulong flags1, uchar prmmsg[8], void *ansbuf, ulong anslen); -/* - * Name: iucv_send2way_prmmsg_array - * Purpose: This function transmits data to another application. - * Prmmsg specifies that the 8-bytes of data are to be moved - * into the parameter list. This is a two-way message and the - * receiver of the message is expected to reply. A buffer - * is provided into which IUCV moves the reply to this - * message. The contents of ansbuf is the address of the - * array of addresses and lengths of discontiguous buffers - * that contain the reply. - * Input: pathid - Path identification number. - * trgcls - Specifies target class. - * srccls - Specifies the source message class. - * msgtag - Specifies a tag to be associated with the message. +/* + * Name: iucv_send2way_prmmsg_array + * Purpose: This function transmits data to another application. + * Prmmsg specifies that the 8-bytes of data are to be moved + * into the parameter list. This is a two-way message and the + * receiver of the message is expected to reply. A buffer + * is provided into which IUCV moves the reply to this + * message. The contents of ansbuf is the address of the + * array of addresses and lengths of discontiguous buffers + * that contain the reply. + * Input: pathid - Path identification number. + * trgcls - Specifies target class. + * srccls - Specifies the source message class. + * msgtag - Specifies a tag to be associated with the message. * flags1 - Option for path. * IPPRTY- 0x20 specifies if you want to send priority message. - * prmmsg - 8-bytes of data to be placed into the parameter list. + * prmmsg - 8-bytes of data to be placed into the parameter list. * ansbuf - Address of array of buffer into which IUCV moves the reply - * of this message. - * anslen - Address of length of reply buffers. - * Output: msgid - Specifies the message ID. - * Return: Return code from CP IUCV call. - * (-EINVAL) - Ansbuf address is NULL. + * of this message. + * anslen - Address of length of reply buffers. + * Output: msgid - Specifies the message ID. + * Return: Return code from CP IUCV call. + * (-EINVAL) - Ansbuf address is NULL. */ int iucv_send2way_prmmsg_array (u16 pathid, u32 * msgid, @@ -821,29 +821,29 @@ int iucv_send2way_prmmsg_array (u16 pathid, uchar prmmsg[8], iucv_array_t * ansbuf, ulong anslen); -/* - * Name: iucv_setmask - * Purpose: This function enables or disables the following IUCV - * external interruptions: Nonpriority and priority message - * interrupts, nonpriority and priority reply interrupts. +/* + * Name: iucv_setmask + * Purpose: This function enables or disables the following IUCV + * external interruptions: Nonpriority and priority message + * interrupts, nonpriority and priority reply interrupts. * Input: SetMaskFlag - options for interrupts - * 0x80 - Nonpriority_MessagePendingInterruptsFlag - * 0x40 - Priority_MessagePendingInterruptsFlag - * 0x20 - Nonpriority_MessageCompletionInterruptsFlag - * 0x10 - Priority_MessageCompletionInterruptsFlag + * 0x80 - Nonpriority_MessagePendingInterruptsFlag + * 0x40 - Priority_MessagePendingInterruptsFlag + * 0x20 - Nonpriority_MessageCompletionInterruptsFlag + * 0x10 - Priority_MessageCompletionInterruptsFlag * 0x08 - IUCVControlInterruptsFlag - * Output: NA - * Return: Return code from CP IUCV call. + * Output: NA + * Return: Return code from CP IUCV call. */ int iucv_setmask (int SetMaskFlag); -/* - * Name: iucv_sever - * Purpose: This function terminates an IUCV path. - * Input: pathid - Path identification number. - * user_data - 16-bytes of user data. - * Output: NA - * Return: Return code from CP IUCV call. - * (-EINVAL) - Interal error, wild pointer. +/* + * Name: iucv_sever + * Purpose: This function terminates an IUCV path. + * Input: pathid - Path identification number. + * user_data - 16-bytes of user data. + * Output: NA + * Return: Return code from CP IUCV call. + * (-EINVAL) - Interal error, wild pointer. */ int iucv_sever (u16 pathid, uchar user_data[16]); diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c index c915bb5d5a93..f94419b334f7 100644 --- a/drivers/s390/net/lcs.c +++ b/drivers/s390/net/lcs.c @@ -1290,7 +1290,7 @@ lcs_set_multicast_list(struct net_device *dev) LCS_DBF_TEXT(4, trace, "setmulti"); card = (struct lcs_card *) dev->priv; - if (!lcs_set_thread_start_bit(card, LCS_SET_MC_THREAD)) + if (!lcs_set_thread_start_bit(card, LCS_SET_MC_THREAD)) schedule_work(&card->kernel_thread_starter); } @@ -1399,7 +1399,7 @@ lcs_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb) /* Check for channel and device errors presented */ rc = lcs_get_problem(cdev, irb); if (rc || (dstat & DEV_STAT_UNIT_EXCEP)) { - PRINT_WARN("check on device %s, dstat=0x%X, cstat=0x%X \n", + PRINT_WARN("check on device %s, dstat=0x%X, cstat=0x%X \n", cdev->dev.bus_id, dstat, cstat); if (rc) { lcs_schedule_recovery(card); @@ -1410,7 +1410,7 @@ lcs_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb) /* How far in the ccw chain have we processed? */ if ((channel->state != CH_STATE_INIT) && (irb->scsw.fctl & SCSW_FCTL_START_FUNC)) { - index = (struct ccw1 *) __va((addr_t) irb->scsw.cpa) + index = (struct ccw1 *) __va((addr_t) irb->scsw.cpa) - channel->ccws; if ((irb->scsw.actl & SCSW_ACTL_SUSPENDED) || (irb->scsw.cstat & SCHN_STAT_PCI)) @@ -1733,7 +1733,7 @@ lcs_start_kernel_thread(struct lcs_card *card) kernel_thread(lcs_recovery, (void *) card, SIGCHLD); #ifdef CONFIG_IP_MULTICAST if (lcs_do_start_thread(card, LCS_SET_MC_THREAD)) - kernel_thread(lcs_register_mc_addresses, + kernel_thread(lcs_register_mc_addresses, (void *) card, SIGCHLD); #endif } @@ -1994,7 +1994,7 @@ lcs_timeout_store (struct device *dev, struct device_attribute *attr, const char DEVICE_ATTR(lancmd_timeout, 0644, lcs_timeout_show, lcs_timeout_store); static ssize_t -lcs_dev_recover_store(struct device *dev, struct device_attribute *attr, +lcs_dev_recover_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct lcs_card *card = dev->driver_data; diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c index 260a93c8c442..b452cc1afd55 100644 --- a/drivers/s390/net/netiucv.c +++ b/drivers/s390/net/netiucv.c @@ -30,7 +30,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ - + #undef DEBUG #include @@ -65,7 +65,7 @@ MODULE_AUTHOR ("(C) 2001 IBM Corporation by Fritz Elfert (felfert@millenux.com)"); MODULE_DESCRIPTION ("Linux for S/390 IUCV network driver"); - + #define PRINTK_HEADER " iucv: " /* for debugging */ static struct device_driver netiucv_driver = { @@ -202,7 +202,7 @@ netiucv_printname(char *name) *p = '\0'; return tmp; } - + /** * States of the interface statemachine. */ @@ -244,7 +244,7 @@ static const char *dev_event_names[] = { "Connection up", "Connection down", }; - + /** * Events of the connection statemachine */ @@ -364,7 +364,7 @@ static const char *conn_state_names[] = { "Connect error", }; - + /** * Debug Facility Stuff */ @@ -516,7 +516,7 @@ static void fsm_action_nop(fsm_instance *fi, int event, void *arg) { } - + /** * Actions of the connection statemachine *****************************************************************************/ @@ -993,7 +993,7 @@ static const fsm_node conn_fsm[] = { static const int CONN_FSM_LEN = sizeof(conn_fsm) / sizeof(fsm_node); - + /** * Actions for interface - statemachine. *****************************************************************************/ @@ -1182,7 +1182,7 @@ netiucv_transmit_skb(struct iucv_connection *conn, struct sk_buff *skb) { fsm_newstate(conn->fsm, CONN_STATE_TX); conn->prof.send_stamp = xtime; - + rc = iucv_send(conn->pathid, NULL, 0, 0, 1 /* single_flag */, 0, nskb->data, nskb->len); /* Shut up, gcc! nskb is always below 2G. */ @@ -1220,7 +1220,7 @@ netiucv_transmit_skb(struct iucv_connection *conn, struct sk_buff *skb) { return rc; } - + /** * Interface API for upper network layers *****************************************************************************/ @@ -1291,7 +1291,7 @@ static int netiucv_tx(struct sk_buff *skb, struct net_device *dev) /** * If connection is not running, try to restart it - * and throw away packet. + * and throw away packet. */ if (fsm_getstate(privptr->fsm) != DEV_STATE_RUNNING) { fsm_event(privptr->fsm, DEV_EVENT_START, dev); @@ -1538,7 +1538,7 @@ static ssize_t maxcq_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct netiucv_priv *priv = dev->driver_data; - + IUCV_DBF_TEXT(trace, 4, __FUNCTION__); priv->conn->prof.maxcqueue = 0; return count; @@ -1559,7 +1559,7 @@ static ssize_t sdoio_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct netiucv_priv *priv = dev->driver_data; - + IUCV_DBF_TEXT(trace, 4, __FUNCTION__); priv->conn->prof.doios_single = 0; return count; @@ -1580,7 +1580,7 @@ static ssize_t mdoio_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct netiucv_priv *priv = dev->driver_data; - + IUCV_DBF_TEXT(trace, 5, __FUNCTION__); priv->conn->prof.doios_multi = 0; return count; @@ -1601,7 +1601,7 @@ static ssize_t txlen_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct netiucv_priv *priv = dev->driver_data; - + IUCV_DBF_TEXT(trace, 4, __FUNCTION__); priv->conn->prof.txlen = 0; return count; @@ -1622,7 +1622,7 @@ static ssize_t txtime_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct netiucv_priv *priv = dev->driver_data; - + IUCV_DBF_TEXT(trace, 4, __FUNCTION__); priv->conn->prof.tx_time = 0; return count; @@ -2000,7 +2000,7 @@ conn_write(struct device_driver *drv, const char *buf, size_t count) } PRINT_INFO("%s: '%s'\n", dev->name, netiucv_printname(username)); - + return count; out_free_ndev: @@ -2099,7 +2099,7 @@ static int __init netiucv_init(void) { int ret; - + ret = iucv_register_dbf_views(); if (ret) { PRINT_WARN("netiucv_init failed, " @@ -2128,7 +2128,7 @@ netiucv_init(void) } return ret; } - + module_init(netiucv_init); module_exit(netiucv_exit); MODULE_LICENSE("GPL"); diff --git a/drivers/s390/net/qeth.h b/drivers/s390/net/qeth.h index 65e2b1bc08a5..619f4a0c7160 100644 --- a/drivers/s390/net/qeth.h +++ b/drivers/s390/net/qeth.h @@ -376,7 +376,7 @@ struct qeth_hdr_osn { __u8 reserved3[18]; __u32 ccid; } __attribute__ ((packed)); - + struct qeth_hdr { union { struct qeth_hdr_layer2 l2; @@ -825,7 +825,7 @@ struct qeth_card { int use_hard_stop; int (*orig_hard_header)(struct sk_buff *,struct net_device *, unsigned short,void *,void *,unsigned); - struct qeth_osn_info osn_info; + struct qeth_osn_info osn_info; }; struct qeth_card_list_struct { @@ -944,7 +944,7 @@ qeth_get_netdev_flags(struct qeth_card *card) return 0; switch (card->info.type) { case QETH_CARD_TYPE_IQD: - case QETH_CARD_TYPE_OSN: + case QETH_CARD_TYPE_OSN: return IFF_NOARP; #ifdef CONFIG_QETH_IPV6 default: @@ -981,7 +981,7 @@ static inline int qeth_get_max_mtu_for_card(int cardtype) { switch (cardtype) { - + case QETH_CARD_TYPE_UNKNOWN: case QETH_CARD_TYPE_OSAE: case QETH_CARD_TYPE_OSN: @@ -1097,7 +1097,7 @@ qeth_string_to_ipaddr4(const char *buf, __u8 *addr) int count = 0, rc = 0; int in[4]; - rc = sscanf(buf, "%d.%d.%d.%d%n", + rc = sscanf(buf, "%d.%d.%d.%d%n", &in[0], &in[1], &in[2], &in[3], &count); if (rc != 4 || count<=0) return -EINVAL; @@ -1131,7 +1131,7 @@ qeth_string_to_ipaddr6(const char *buf, __u8 *addr) cnt = out = found = save_cnt = num2 = 0; end = start = (char *) buf; - in = (__u16 *) addr; + in = (__u16 *) addr; memset(in, 0, 16); while (end) { end = strchr(end,':'); @@ -1139,7 +1139,7 @@ qeth_string_to_ipaddr6(const char *buf, __u8 *addr) end = (char *)buf + (strlen(buf)); out = 1; } - if ((end - start)) { + if ((end - start)) { memset(num, 0, 5); memcpy(num, start, end - start); if (!qeth_isxdigit(num)) @@ -1241,5 +1241,5 @@ qeth_osn_register(unsigned char *read_dev_no, extern void qeth_osn_deregister(struct net_device *); - + #endif /* __QETH_H__ */ diff --git a/drivers/s390/net/qeth_eddp.c b/drivers/s390/net/qeth_eddp.c index 44e226f211e7..0bab60a20309 100644 --- a/drivers/s390/net/qeth_eddp.c +++ b/drivers/s390/net/qeth_eddp.c @@ -81,7 +81,7 @@ void qeth_eddp_buf_release_contexts(struct qeth_qdio_out_buffer *buf) { struct qeth_eddp_context_reference *ref; - + QETH_DBF_TEXT(trace, 6, "eddprctx"); while (!list_empty(&buf->ctx_list)){ ref = list_entry(buf->ctx_list.next, @@ -135,7 +135,7 @@ qeth_eddp_fill_buffer(struct qeth_qdio_out_q *queue, "buffer!\n"); goto out; } - } + } /* check if the whole next skb fits into current buffer */ if ((QETH_MAX_BUFFER_ELEMENTS(queue->card) - buf->next_element_to_fill) @@ -148,7 +148,7 @@ qeth_eddp_fill_buffer(struct qeth_qdio_out_q *queue, * and increment ctx's refcnt */ must_refcnt = 1; continue; - } + } if (must_refcnt){ must_refcnt = 0; if (qeth_eddp_buf_ref_context(buf, ctx)){ @@ -266,7 +266,7 @@ qeth_eddp_copy_data_tcp(char *dst, struct qeth_eddp_data *eddp, int len, int left_in_frag; int copy_len; u8 *src; - + QETH_DBF_TEXT(trace, 5, "eddpcdtc"); if (skb_shinfo(eddp->skb)->nr_frags == 0) { memcpy(dst, eddp->skb->data + eddp->skb_offset, len); @@ -408,7 +408,7 @@ __qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx, struct tcphdr *tcph; int data_len; u32 hcsum; - + QETH_DBF_TEXT(trace, 5, "eddpftcp"); eddp->skb_offset = sizeof(struct qeth_hdr) + eddp->nhl + eddp->thl; if (eddp->qh.hdr.l2.id == QETH_HEADER_TYPE_LAYER2) { @@ -465,13 +465,13 @@ __qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx, eddp->th.tcp.h.seq += data_len; } } - + static inline int qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx, struct sk_buff *skb, struct qeth_hdr *qhdr) { struct qeth_eddp_data *eddp = NULL; - + QETH_DBF_TEXT(trace, 5, "eddpficx"); /* create our segmentation headers and copy original headers */ if (skb->protocol == ETH_P_IP) @@ -512,7 +512,7 @@ qeth_eddp_calc_num_pages(struct qeth_eddp_context *ctx, struct sk_buff *skb, int hdr_len) { int skbs_per_page; - + QETH_DBF_TEXT(trace, 5, "eddpcanp"); /* can we put multiple skbs in one page? */ skbs_per_page = PAGE_SIZE / (skb_shinfo(skb)->tso_size + hdr_len); @@ -588,7 +588,7 @@ qeth_eddp_create_context_tcp(struct qeth_card *card, struct sk_buff *skb, struct qeth_hdr *qhdr) { struct qeth_eddp_context *ctx = NULL; - + QETH_DBF_TEXT(trace, 5, "creddpct"); if (skb->protocol == ETH_P_IP) ctx = qeth_eddp_create_context_generic(card, skb, diff --git a/drivers/s390/net/qeth_fs.h b/drivers/s390/net/qeth_fs.h index e422b41c656e..61faf05517d6 100644 --- a/drivers/s390/net/qeth_fs.h +++ b/drivers/s390/net/qeth_fs.h @@ -42,7 +42,7 @@ qeth_create_device_attributes_osn(struct device *dev); extern void qeth_remove_device_attributes_osn(struct device *dev); - + extern int qeth_create_driver_attributes(void); diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index 9dbb5be2b63c..9e671a48cd2f 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c @@ -513,7 +513,7 @@ __qeth_set_offline(struct ccwgroup_device *cgdev, int recovery_mode) QETH_DBF_TEXT(setup, 3, "setoffl"); QETH_DBF_HEX(setup, 3, &card, sizeof(void *)); - + if (card->dev && netif_carrier_ok(card->dev)) netif_carrier_off(card->dev); recover_flag = card->state; @@ -604,13 +604,13 @@ __qeth_ref_ip_on_card(struct qeth_card *card, struct qeth_ipaddr *todo, list_for_each_entry(addr, &card->ip_list, entry) { if (card->options.layer2) { if ((addr->type == todo->type) && - (memcmp(&addr->mac, &todo->mac, + (memcmp(&addr->mac, &todo->mac, OSA_ADDR_LEN) == 0)) { found = 1; break; } continue; - } + } if ((addr->proto == QETH_PROT_IPV4) && (todo->proto == QETH_PROT_IPV4) && (addr->type == todo->type) && @@ -694,13 +694,13 @@ __qeth_insert_ip_todo(struct qeth_card *card, struct qeth_ipaddr *addr, int add) if (card->options.layer2) { if ((tmp->type == addr->type) && (tmp->is_multicast == addr->is_multicast) && - (memcmp(&tmp->mac, &addr->mac, + (memcmp(&tmp->mac, &addr->mac, OSA_ADDR_LEN) == 0)) { found = 1; break; } continue; - } + } if ((tmp->proto == QETH_PROT_IPV4) && (addr->proto == QETH_PROT_IPV4) && (tmp->type == addr->type) && @@ -1173,7 +1173,7 @@ qeth_determine_card_type(struct qeth_card *card) "due to hardware limitations!\n"); card->qdio.no_out_queues = 1; card->qdio.default_out_queue = 0; - } + } return 0; } i++; @@ -1198,7 +1198,7 @@ qeth_probe_device(struct ccwgroup_device *gdev) return -ENODEV; QETH_DBF_TEXT_(setup, 2, "%s", gdev->dev.bus_id); - + card = qeth_alloc_card(); if (!card) { put_device(dev); @@ -1220,7 +1220,7 @@ qeth_probe_device(struct ccwgroup_device *gdev) put_device(dev); qeth_free_card(card); return rc; - } + } if ((rc = qeth_setup_card(card))){ QETH_DBF_TEXT_(setup, 2, "2err%d", rc); put_device(dev); @@ -1843,7 +1843,7 @@ struct qeth_cmd_buffer *iob) &card->seqno.pdu_hdr_ack, QETH_SEQ_NO_LENGTH); QETH_DBF_HEX(control, 2, iob->data, QETH_DBF_CONTROL_LEN); } - + static int qeth_send_control_data(struct qeth_card *card, int len, struct qeth_cmd_buffer *iob, @@ -1937,7 +1937,7 @@ qeth_osn_send_control_data(struct qeth_card *card, int len, wake_up(&card->wait_q); } return rc; -} +} static inline void qeth_prepare_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob, @@ -1966,7 +1966,7 @@ qeth_osn_send_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob, memcpy(QETH_IPA_PDU_LEN_PDU3(iob->data), &s2, 2); return qeth_osn_send_control_data(card, s1, iob); } - + static int qeth_send_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob, int (*reply_cb) @@ -2579,7 +2579,7 @@ qeth_process_inbound_buffer(struct qeth_card *card, skb->dev = card->dev; if (hdr->hdr.l2.id == QETH_HEADER_TYPE_LAYER2) vlan_tag = qeth_layer2_rebuild_skb(card, skb, hdr); - else if (hdr->hdr.l3.id == QETH_HEADER_TYPE_LAYER3) + else if (hdr->hdr.l3.id == QETH_HEADER_TYPE_LAYER3) qeth_rebuild_skb(card, skb, hdr); else { /*in case of OSN*/ skb_push(skb, sizeof(struct qeth_hdr)); @@ -2763,7 +2763,7 @@ qeth_qdio_input_handler(struct ccw_device * ccwdev, unsigned int status, index = i % QDIO_MAX_BUFFERS_PER_Q; buffer = &card->qdio.in_q->bufs[index]; if (!((status & QDIO_STATUS_LOOK_FOR_ERROR) && - qeth_check_qdio_errors(buffer->buffer, + qeth_check_qdio_errors(buffer->buffer, qdio_err, siga_err,"qinerr"))) qeth_process_inbound_buffer(card, buffer, index); /* clear buffer and give back to hardware */ @@ -3187,7 +3187,7 @@ qeth_alloc_qdio_buffers(struct qeth_card *card) if (card->qdio.state == QETH_QDIO_ALLOCATED) return 0; - card->qdio.in_q = kmalloc(sizeof(struct qeth_qdio_q), + card->qdio.in_q = kmalloc(sizeof(struct qeth_qdio_q), GFP_KERNEL|GFP_DMA); if (!card->qdio.in_q) return - ENOMEM; @@ -3476,7 +3476,7 @@ qeth_halt_channels(struct qeth_card *card) rc3 = qeth_halt_channel(&card->data); if (rc1) return rc1; - if (rc2) + if (rc2) return rc2; return rc3; } @@ -3491,7 +3491,7 @@ qeth_clear_channels(struct qeth_card *card) rc3 = qeth_clear_channel(&card->data); if (rc1) return rc1; - if (rc2) + if (rc2) return rc2; return rc3; } @@ -3802,7 +3802,7 @@ qeth_open(struct net_device *dev) card->state = CARD_STATE_UP; card->dev->flags |= IFF_UP; netif_start_queue(dev); - + if (!card->lan_online && netif_carrier_ok(dev)) netif_carrier_off(dev); return 0; @@ -4098,7 +4098,7 @@ qeth_fill_header(struct qeth_card *card, struct qeth_hdr *hdr, } } else { /* passthrough */ if((skb->dev->type == ARPHRD_IEEE802_TR) && - !memcmp(skb->data + sizeof(struct qeth_hdr) + + !memcmp(skb->data + sizeof(struct qeth_hdr) + sizeof(__u16), skb->dev->broadcast, 6)) { hdr->hdr.l3.flags = QETH_CAST_BROADCAST | QETH_HDR_PASSTHRU; @@ -4385,7 +4385,7 @@ out: } static inline int -qeth_get_elements_no(struct qeth_card *card, void *hdr, +qeth_get_elements_no(struct qeth_card *card, void *hdr, struct sk_buff *skb, int elems) { int elements_needed = 0; @@ -4443,7 +4443,7 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb) return 0; } cast_type = qeth_get_cast_type(card, skb); - if ((cast_type == RTN_BROADCAST) && + if ((cast_type == RTN_BROADCAST) && (card->info.broadcast_capable == 0)){ card->stats.tx_dropped++; card->stats.tx_errors++; @@ -4465,7 +4465,7 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb) card->stats.tx_errors++; dev_kfree_skb_any(skb); return NETDEV_TX_OK; - } + } elements_needed++; } else { if ((rc = qeth_prepare_skb(card, &skb, &hdr, ipv))) { @@ -5375,7 +5375,7 @@ qeth_layer2_send_setdelvlan_cb(struct qeth_card *card, cmd = (struct qeth_ipa_cmd *) data; if (cmd->hdr.return_code) { PRINT_ERR("Error in processing VLAN %i on %s: 0x%x. " - "Continuing\n",cmd->data.setdelvlan.vlan_id, + "Continuing\n",cmd->data.setdelvlan.vlan_id, QETH_CARD_IFNAME(card), cmd->hdr.return_code); QETH_DBF_TEXT_(trace, 2, "L2VL%4x", cmd->hdr.command); QETH_DBF_TEXT_(trace, 2, "L2%s", CARD_BUS_ID(card)); @@ -5395,7 +5395,7 @@ qeth_layer2_send_setdelvlan(struct qeth_card *card, __u16 i, iob = qeth_get_ipacmd_buffer(card, ipacmd, QETH_PROT_IPV4); cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE); cmd->data.setdelvlan.vlan_id = i; - return qeth_send_ipa_cmd(card, iob, + return qeth_send_ipa_cmd(card, iob, qeth_layer2_send_setdelvlan_cb, NULL); } @@ -5459,7 +5459,7 @@ qeth_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) * Examine hardware response to SET_PROMISC_MODE */ static int -qeth_setadp_promisc_mode_cb(struct qeth_card *card, +qeth_setadp_promisc_mode_cb(struct qeth_card *card, struct qeth_reply *reply, unsigned long data) { @@ -5470,10 +5470,10 @@ qeth_setadp_promisc_mode_cb(struct qeth_card *card, cmd = (struct qeth_ipa_cmd *) data; setparms = &(cmd->data.setadapterparms); - + qeth_default_setadapterparms_cb(card, reply, (unsigned long)cmd); - if (cmd->hdr.return_code) { - QETH_DBF_TEXT_(trace,4,"prmrc%2.2x",cmd->hdr.return_code); + if (cmd->hdr.return_code) { + QETH_DBF_TEXT_(trace,4,"prmrc%2.2x",cmd->hdr.return_code); setparms->data.mode = SET_PROMISC_MODE_OFF; } card->info.promisc_mode = setparms->data.mode; @@ -5519,7 +5519,7 @@ qeth_set_multicast_list(struct net_device *dev) if (card->info.type == QETH_CARD_TYPE_OSN) return ; - + QETH_DBF_TEXT(trace, 3, "setmulti"); qeth_delete_mc_addresses(card); if (card->options.layer2) { @@ -5577,7 +5577,7 @@ qeth_osn_assist(struct net_device *dev, struct qeth_cmd_buffer *iob; struct qeth_card *card; int rc; - + QETH_DBF_TEXT(trace, 2, "osnsdmc"); if (!dev) return -ENODEV; @@ -5656,7 +5656,7 @@ qeth_osn_deregister(struct net_device * dev) card->osn_info.data_cb = NULL; return; } - + static void qeth_delete_mc_addresses(struct qeth_card *card) { @@ -5820,7 +5820,7 @@ qeth_add_multicast_ipv6(struct qeth_card *card) struct inet6_dev *in6_dev; QETH_DBF_TEXT(trace,4,"chkmcv6"); - if (!qeth_is_supported(card, IPA_IPV6)) + if (!qeth_is_supported(card, IPA_IPV6)) return ; in6_dev = in6_dev_get(card->dev); if (in6_dev == NULL) @@ -6372,7 +6372,7 @@ qeth_netdev_init(struct net_device *dev) if (!(card->info.unique_id & UNIQUE_ID_NOT_BY_CARD)) card->dev->dev_id = card->info.unique_id & 0xffff; #endif - if (card->options.fake_ll && + if (card->options.fake_ll && (qeth_get_netdev_flags(card) & IFF_NOARP)) dev->hard_header = qeth_fake_header; dev->hard_header_parse = NULL; @@ -6479,7 +6479,7 @@ retry: /*network device will be recovered*/ if (card->dev) { card->dev->hard_header = card->orig_hard_header; - if (card->options.fake_ll && + if (card->options.fake_ll && (qeth_get_netdev_flags(card) & IFF_NOARP)) card->dev->hard_header = qeth_fake_header; return 0; @@ -6589,7 +6589,7 @@ qeth_setadpparms_change_macaddr_cb(struct qeth_card *card, cmd = (struct qeth_ipa_cmd *) data; if (!card->options.layer2 || card->info.guestlan || - !(card->info.mac_bits & QETH_LAYER2_MAC_READ)) { + !(card->info.mac_bits & QETH_LAYER2_MAC_READ)) { memcpy(card->dev->dev_addr, &cmd->data.setadapterparms.data.change_addr.addr, OSA_ADDR_LEN); @@ -7572,7 +7572,7 @@ qeth_stop_card(struct qeth_card *card, int recovery_mode) if (card->read.state == CH_STATE_UP && card->write.state == CH_STATE_UP && (card->state == CARD_STATE_UP)) { - if (recovery_mode && + if (recovery_mode && card->info.type != QETH_CARD_TYPE_OSN) { qeth_stop(card->dev); } else { @@ -7741,7 +7741,7 @@ static int qeth_register_netdev(struct qeth_card *card) { QETH_DBF_TEXT(setup, 3, "regnetd"); - if (card->dev->reg_state != NETREG_UNINITIALIZED) + if (card->dev->reg_state != NETREG_UNINITIALIZED) return 0; /* sysfs magic */ SET_NETDEV_DEV(card->dev, &card->gdev->dev); @@ -7753,7 +7753,7 @@ qeth_start_again(struct qeth_card *card, int recovery_mode) { QETH_DBF_TEXT(setup ,2, "startag"); - if (recovery_mode && + if (recovery_mode && card->info.type != QETH_CARD_TYPE_OSN) { qeth_open(card->dev); } else { diff --git a/drivers/s390/net/qeth_mpc.h b/drivers/s390/net/qeth_mpc.h index 011c41041029..0477c47471c5 100644 --- a/drivers/s390/net/qeth_mpc.h +++ b/drivers/s390/net/qeth_mpc.h @@ -445,7 +445,7 @@ enum qeth_ipa_arp_return_codes { /* Helper functions */ #define IS_IPA_REPLY(cmd) ((cmd->hdr.initiator == IPA_CMD_INITIATOR_HOST) || \ (cmd->hdr.initiator == IPA_CMD_INITIATOR_OSA_REPLY)) - + /*****************************************************************************/ /* END OF IP Assist related definitions */ /*****************************************************************************/ @@ -490,7 +490,7 @@ extern unsigned char ULP_ENABLE[]; /* Layer 2 defintions */ #define QETH_PROT_LAYER2 0x08 #define QETH_PROT_TCPIP 0x03 -#define QETH_PROT_OSN2 0x0a +#define QETH_PROT_OSN2 0x0a #define QETH_ULP_ENABLE_PROT_TYPE(buffer) (buffer+0x50) #define QETH_IPA_CMD_PROT_TYPE(buffer) (buffer+0x19) diff --git a/drivers/s390/net/qeth_proc.c b/drivers/s390/net/qeth_proc.c index 360d782c7ada..66f2da14e6e3 100644 --- a/drivers/s390/net/qeth_proc.c +++ b/drivers/s390/net/qeth_proc.c @@ -36,7 +36,7 @@ qeth_procfile_seq_start(struct seq_file *s, loff_t *offset) { struct device *dev = NULL; loff_t nr = 0; - + down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); if (*offset == 0) return SEQ_START_TOKEN; @@ -60,8 +60,8 @@ static void * qeth_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) { struct device *prev, *next; - - if (it == SEQ_START_TOKEN) + + if (it == SEQ_START_TOKEN) prev = NULL; else prev = (struct device *) it; @@ -180,7 +180,7 @@ qeth_perf_procfile_seq_show(struct seq_file *s, void *it) struct device *device; struct qeth_card *card; - + if (it == SEQ_START_TOKEN) return 0; diff --git a/drivers/s390/net/qeth_sys.c b/drivers/s390/net/qeth_sys.c index 882d419e4160..185a9cfbcbdc 100644 --- a/drivers/s390/net/qeth_sys.c +++ b/drivers/s390/net/qeth_sys.c @@ -785,7 +785,7 @@ qeth_dev_large_send_store(struct device *dev, struct device_attribute *attr, con } if (card->options.large_send == type) return count; - if ((rc = qeth_set_large_send(card, type))) + if ((rc = qeth_set_large_send(card, type))) return rc; return count; } @@ -1682,7 +1682,7 @@ qeth_create_device_attributes(struct device *dev) if (card->info.type == QETH_CARD_TYPE_OSN) return sysfs_create_group(&dev->kobj, &qeth_osn_device_attr_group); - + if ((ret = sysfs_create_group(&dev->kobj, &qeth_device_attr_group))) return ret; if ((ret = sysfs_create_group(&dev->kobj, &qeth_device_ipato_group))){ @@ -1713,7 +1713,7 @@ qeth_remove_device_attributes(struct device *dev) if (card->info.type == QETH_CARD_TYPE_OSN) return sysfs_remove_group(&dev->kobj, &qeth_osn_device_attr_group); - + sysfs_remove_group(&dev->kobj, &qeth_device_attr_group); sysfs_remove_group(&dev->kobj, &qeth_device_ipato_group); sysfs_remove_group(&dev->kobj, &qeth_device_vipa_group); diff --git a/drivers/s390/net/qeth_tso.h b/drivers/s390/net/qeth_tso.h index 1286ddea450b..24ef40ca9562 100644 --- a/drivers/s390/net/qeth_tso.h +++ b/drivers/s390/net/qeth_tso.h @@ -117,11 +117,11 @@ __qeth_fill_buffer_frag(struct sk_buff *skb, struct qdio_buffer *buffer, int fragno; unsigned long addr; int element, cnt, dlen; - + fragno = skb_shinfo(skb)->nr_frags; element = *next_element_to_fill; dlen = 0; - + if (is_tso) buffer->element[element].flags = SBAL_FLAGS_MIDDLE_FRAG; -- cgit v1.2.2 From 0737ac895afbfbe210557fa5fbafcca932d5fa7c Mon Sep 17 00:00:00 2001 From: Mark Lord Date: Sun, 28 May 2006 11:28:00 -0400 Subject: [PATCH] the latest consensus libata resume fix Okay, just to sum things up. This forces libata to wait for up to 2 seconds for BUSY|DRQ to clear on resume before continuing. [jgarzik adds...] During testing we never saw DRQ asserted, but nonetheless (a) this works and (b) testing for DRQ won't hurt. Signed-off-by: Mark Lord Acked-by: Jens Axboe Signed-off-by: Jeff Garzik --- drivers/scsi/libata-core.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers') diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index fa476e7e0a48..b046ffa22101 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c @@ -4297,6 +4297,7 @@ static int ata_start_drive(struct ata_port *ap, struct ata_device *dev) int ata_device_resume(struct ata_port *ap, struct ata_device *dev) { if (ap->flags & ATA_FLAG_SUSPENDED) { + ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 200000); ap->flags &= ~ATA_FLAG_SUSPENDED; ata_set_mode(ap); } -- cgit v1.2.2 From 7363cfc8666692a5263c646e68e54900b536cd7e Mon Sep 17 00:00:00 2001 From: Jesper Juhl Date: Mon, 29 May 2006 23:28:05 -0400 Subject: Input: sidewinder - fix memory leak In sw_connect we leak 'buf' and 'idbuf' when we do not leave via one of the fail* labels. This was spotted by the coverity checker. Patch is compile tested only due to lack of hardware. Signed-off-by: Jesper Juhl Signed-off-by: Dmitry Torokhov --- drivers/input/joystick/sidewinder.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'drivers') diff --git a/drivers/input/joystick/sidewinder.c b/drivers/input/joystick/sidewinder.c index 2b2ec1057dee..95c0de7964a0 100644 --- a/drivers/input/joystick/sidewinder.c +++ b/drivers/input/joystick/sidewinder.c @@ -589,7 +589,7 @@ static int sw_connect(struct gameport *gameport, struct gameport_driver *drv) struct sw *sw; struct input_dev *input_dev; int i, j, k, l; - int err; + int err = 0; unsigned char *buf = NULL; /* [SW_LENGTH] */ unsigned char *idbuf = NULL; /* [SW_LENGTH] */ unsigned char m = 1; @@ -776,7 +776,10 @@ static int sw_connect(struct gameport *gameport, struct gameport_driver *drv) goto fail4; } - return 0; + out: kfree(buf); + kfree(idbuf); + + return err; fail4: input_free_device(sw->dev[i]); fail3: while (--i >= 0) @@ -784,9 +787,7 @@ static int sw_connect(struct gameport *gameport, struct gameport_driver *drv) fail2: gameport_close(gameport); fail1: gameport_set_drvdata(gameport, NULL); kfree(sw); - kfree(buf); - kfree(idbuf); - return err; + goto out; } static void sw_disconnect(struct gameport *gameport) -- cgit v1.2.2 From 4f8b05efec7a56221c6d1b0e20bcf19671017065 Mon Sep 17 00:00:00 2001 From: Zbigniew Luszpinski Date: Mon, 29 May 2006 23:29:19 -0400 Subject: Input: psmouse - add detection of Logitech TrackMan Wheel trackball Signed-off-by: Dmitry Torokhov --- drivers/input/mouse/logips2pp.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers') diff --git a/drivers/input/mouse/logips2pp.c b/drivers/input/mouse/logips2pp.c index 40333d61093c..2f0d28840810 100644 --- a/drivers/input/mouse/logips2pp.c +++ b/drivers/input/mouse/logips2pp.c @@ -19,6 +19,7 @@ #define PS2PP_KIND_WHEEL 1 #define PS2PP_KIND_MX 2 #define PS2PP_KIND_TP3 3 +#define PS2PP_KIND_TRACKMAN 4 /* Logitech mouse features */ #define PS2PP_WHEEL 0x01 @@ -223,6 +224,7 @@ static struct ps2pp_info *get_model_info(unsigned char model) { 73, 0, PS2PP_SIDE_BTN }, { 75, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, { 76, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, + { 79, PS2PP_KIND_TRACKMAN, PS2PP_WHEEL }, /* TrackMan with wheel */ { 80, PS2PP_KIND_WHEEL, PS2PP_SIDE_BTN | PS2PP_WHEEL }, { 81, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, { 83, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, @@ -298,6 +300,10 @@ static void ps2pp_set_model_properties(struct psmouse *psmouse, struct ps2pp_inf psmouse->name = "TouchPad 3"; break; + case PS2PP_KIND_TRACKMAN: + psmouse->name = "TrackMan"; + break; + default: /* * Set name to "Mouse" only when using PS2++, -- cgit v1.2.2 From e107b8ee7e97fc20695ca3d5ef862511eca28df0 Mon Sep 17 00:00:00 2001 From: "masc@theaterzentrum.at" Date: Mon, 29 May 2006 23:29:36 -0400 Subject: Input: wistron - add support for AOpen Barebook 1559as Signed-off-by: Dmitry Torokhov --- drivers/input/misc/wistron_btns.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'drivers') diff --git a/drivers/input/misc/wistron_btns.c b/drivers/input/misc/wistron_btns.c index 36cd2e07fce8..e4e5be111c96 100644 --- a/drivers/input/misc/wistron_btns.c +++ b/drivers/input/misc/wistron_btns.c @@ -318,6 +318,16 @@ static struct key_entry keymap_acer_travelmate_240[] = { { KE_END, 0 } }; +static struct key_entry keymap_aopen_1559as[] = { + { KE_KEY, 0x01, KEY_HELP }, + { KE_KEY, 0x06, KEY_PROG3 }, + { KE_KEY, 0x11, KEY_PROG1 }, + { KE_KEY, 0x12, KEY_PROG2 }, + { KE_WIFI, 0x30, 0 }, + { KE_KEY, 0x31, KEY_MAIL }, + { KE_KEY, 0x36, KEY_WWW }, +}; + /* * If your machine is not here (which is currently rather likely), please send * a list of buttons and their key codes (reported when loading this module @@ -369,6 +379,15 @@ static struct dmi_system_id dmi_ids[] = { }, .driver_data = keymap_acer_travelmate_240 }, + { + .callback = dmi_matched, + .ident = "AOpen 1559AS", + .matches = { + DMI_MATCH(DMI_PRODUCT_NAME, "E2U"), + DMI_MATCH(DMI_BOARD_NAME, "E2U"), + }, + .driver_data = keymap_aopen_1559as + }, { NULL, } }; -- cgit v1.2.2 From d2f4012f15845761bd3c6f90172e53767c11e359 Mon Sep 17 00:00:00 2001 From: Yotam Medini Date: Mon, 29 May 2006 23:30:36 -0400 Subject: Input: alps - fix old protocol decoding Correct touchpad left & right keys assignments for ALPS_OLDPROTO that were swapped. Old protocol is used on UMAX ActionBook-530T notebook. Signed-off-by: Yotam Medini Signed-off-by: Dmitry Torokhov --- drivers/input/mouse/alps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index 2141501e9f2e..a0e2e797c6d5 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c @@ -100,8 +100,8 @@ static void alps_process_packet(struct psmouse *psmouse, struct pt_regs *regs) } if (priv->i->flags & ALPS_OLDPROTO) { - left = packet[2] & 0x08; - right = packet[2] & 0x10; + left = packet[2] & 0x10; + right = packet[2] & 0x08; middle = 0; x = packet[1] | ((packet[0] & 0x07) << 7); y = packet[4] | ((packet[3] & 0x07) << 7); -- cgit v1.2.2 From ed8f9e2f047de5d9b791e390269f230a101a6a4b Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Mon, 29 May 2006 23:31:03 -0400 Subject: Input: change from numbered to named switches Remove the numbered SW_* entries from the input system and assign names to the existing users. Signed-off-by: Richard Purdie Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/corgikbd.c | 12 ++++++------ drivers/input/keyboard/spitzkbd.c | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'drivers') diff --git a/drivers/input/keyboard/corgikbd.c b/drivers/input/keyboard/corgikbd.c index 96c6bf77248a..1f0e720267d7 100644 --- a/drivers/input/keyboard/corgikbd.c +++ b/drivers/input/keyboard/corgikbd.c @@ -245,9 +245,9 @@ static void corgikbd_hinge_timer(unsigned long data) if (hinge_count >= HINGE_STABLE_COUNT) { spin_lock_irqsave(&corgikbd_data->lock, flags); - input_report_switch(corgikbd_data->input, SW_0, ((sharpsl_hinge_state & CORGI_SCP_SWA) != 0)); - input_report_switch(corgikbd_data->input, SW_1, ((sharpsl_hinge_state & CORGI_SCP_SWB) != 0)); - input_report_switch(corgikbd_data->input, SW_2, (READ_GPIO_BIT(CORGI_GPIO_AK_INT) != 0)); + input_report_switch(corgikbd_data->input, SW_LID, ((sharpsl_hinge_state & CORGI_SCP_SWA) != 0)); + input_report_switch(corgikbd_data->input, SW_TABLET_MODE, ((sharpsl_hinge_state & CORGI_SCP_SWB) != 0)); + input_report_switch(corgikbd_data->input, SW_HEADPHONE_INSERT, (READ_GPIO_BIT(CORGI_GPIO_AK_INT) != 0)); input_sync(corgikbd_data->input); spin_unlock_irqrestore(&corgikbd_data->lock, flags); @@ -340,9 +340,9 @@ static int __init corgikbd_probe(struct platform_device *pdev) for (i = 0; i < ARRAY_SIZE(corgikbd_keycode); i++) set_bit(corgikbd->keycode[i], input_dev->keybit); clear_bit(0, input_dev->keybit); - set_bit(SW_0, input_dev->swbit); - set_bit(SW_1, input_dev->swbit); - set_bit(SW_2, input_dev->swbit); + set_bit(SW_LID, input_dev->swbit); + set_bit(SW_TABLET_MODE, input_dev->swbit); + set_bit(SW_HEADPHONE_INSERT, input_dev->swbit); input_register_device(corgikbd->input); diff --git a/drivers/input/keyboard/spitzkbd.c b/drivers/input/keyboard/spitzkbd.c index 1d238a9d52d6..c5d03fb77bcb 100644 --- a/drivers/input/keyboard/spitzkbd.c +++ b/drivers/input/keyboard/spitzkbd.c @@ -299,9 +299,9 @@ static void spitzkbd_hinge_timer(unsigned long data) if (hinge_count >= HINGE_STABLE_COUNT) { spin_lock_irqsave(&spitzkbd_data->lock, flags); - input_report_switch(spitzkbd_data->input, SW_0, ((GPLR(SPITZ_GPIO_SWA) & GPIO_bit(SPITZ_GPIO_SWA)) != 0)); - input_report_switch(spitzkbd_data->input, SW_1, ((GPLR(SPITZ_GPIO_SWB) & GPIO_bit(SPITZ_GPIO_SWB)) != 0)); - input_report_switch(spitzkbd_data->input, SW_2, ((GPLR(SPITZ_GPIO_AK_INT) & GPIO_bit(SPITZ_GPIO_AK_INT)) != 0)); + input_report_switch(spitzkbd_data->input, SW_LID, ((GPLR(SPITZ_GPIO_SWA) & GPIO_bit(SPITZ_GPIO_SWA)) != 0)); + input_report_switch(spitzkbd_data->input, SW_TABLET_MODE, ((GPLR(SPITZ_GPIO_SWB) & GPIO_bit(SPITZ_GPIO_SWB)) != 0)); + input_report_switch(spitzkbd_data->input, SW_HEADPHONE_INSERT, ((GPLR(SPITZ_GPIO_AK_INT) & GPIO_bit(SPITZ_GPIO_AK_INT)) != 0)); input_sync(spitzkbd_data->input); spin_unlock_irqrestore(&spitzkbd_data->lock, flags); @@ -398,9 +398,9 @@ static int __init spitzkbd_probe(struct platform_device *dev) for (i = 0; i < ARRAY_SIZE(spitzkbd_keycode); i++) set_bit(spitzkbd->keycode[i], input_dev->keybit); clear_bit(0, input_dev->keybit); - set_bit(SW_0, input_dev->swbit); - set_bit(SW_1, input_dev->swbit); - set_bit(SW_2, input_dev->swbit); + set_bit(SW_LID, input_dev->swbit); + set_bit(SW_TABLET_MODE, input_dev->swbit); + set_bit(SW_HEADPHONE_INSERT, input_dev->swbit); input_register_device(input_dev); -- cgit v1.2.2 From 47ce56edb8ecdd4ec2bbec4e8683f3ba91de72e3 Mon Sep 17 00:00:00 2001 From: Kenan Esau Date: Mon, 29 May 2006 23:31:12 -0400 Subject: Input: psmouse - DMI updates for lifebook protocol Added different lifebook-versions and the CF-18 to the corresponding dmi-table. Signed-off-by: Kenan Esau Signed-off-by: Dmitry Torokhov --- drivers/input/mouse/lifebook.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'drivers') diff --git a/drivers/input/mouse/lifebook.c b/drivers/input/mouse/lifebook.c index 5ccc3ef3b89e..c14395ba7980 100644 --- a/drivers/input/mouse/lifebook.c +++ b/drivers/input/mouse/lifebook.c @@ -21,12 +21,36 @@ #include "lifebook.h" static struct dmi_system_id lifebook_dmi_table[] = { + { + .ident = "LifeBook B", + .matches = { + DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B Series"), + }, + }, { .ident = "Lifebook B", .matches = { DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK B Series"), }, }, + { + .ident = "Lifebook B213x/B2150", + .matches = { + DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B2131/B2133/B2150"), + }, + }, + { + .ident = "Zephyr", + .matches = { + DMI_MATCH(DMI_PRODUCT_NAME, "ZEPHYR"), + }, + }, + { + .ident = "CF-18", + .matches = { + DMI_MATCH(DMI_PRODUCT_NAME, "CF-18"), + }, + }, { .ident = "Lifebook B142", .matches = { -- cgit v1.2.2 From 308af9290ad1844c1b4e93ff4919f8009efbe018 Mon Sep 17 00:00:00 2001 From: David Hollister Date: Tue, 30 May 2006 21:25:36 -0700 Subject: [PATCH] fbcon: fix scrollback with logo issue immediately after boot From: David Hollister After the system boots with the logo, if the first action is a scrollback, the screen may become garbled. This patch ensures that the softback_curr value is updated along with softback_in following the scrollback. Signed-off-by: David Hollister Signed-off-by: Jordan Crouse Cc: "Antonino A. Daplas" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/console/fbcon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index ca020719d20b..953eb8c171d6 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c @@ -2631,7 +2631,7 @@ static int fbcon_scrolldelta(struct vc_data *vc, int lines) scr_memcpyw((u16 *) q, (u16 *) p, vc->vc_size_row); } - softback_in = p; + softback_in = softback_curr = p; update_region(vc, vc->vc_origin, logo_lines * vc->vc_cols); } -- cgit v1.2.2 From de66a695bef17264b2472c06e981c068bfa0636e Mon Sep 17 00:00:00 2001 From: Seiji Munetoh Date: Tue, 30 May 2006 21:25:47 -0700 Subject: [PATCH] tpm: bios log parsing fixes From: Seiji Munetoh Fix "tcpa_pc_event" misalignment between enum, strings and TCG PC spec and output of the event which contains a hash data. Signed-off-by: Seiji Munetoh Acked-by: Kylene Hall Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/char/tpm/tpm_bios.c | 41 +++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-) (limited to 'drivers') diff --git a/drivers/char/tpm/tpm_bios.c b/drivers/char/tpm/tpm_bios.c index e45f0d3d12de..60380174f245 100644 --- a/drivers/char/tpm/tpm_bios.c +++ b/drivers/char/tpm/tpm_bios.c @@ -105,6 +105,12 @@ static const char* tcpa_event_type_strings[] = { "Non-Host Info" }; +struct tcpa_pc_event { + u32 event_id; + u32 event_size; + u8 event_data[0]; +}; + enum tcpa_pc_event_ids { SMBIOS = 1, BIS_CERT, @@ -114,14 +120,15 @@ enum tcpa_pc_event_ids { NVRAM, OPTION_ROM_EXEC, OPTION_ROM_CONFIG, - OPTION_ROM_MICROCODE, + OPTION_ROM_MICROCODE = 10, S_CRTM_VERSION, S_CRTM_CONTENTS, POST_CONTENTS, + HOST_TABLE_OF_DEVICES, }; static const char* tcpa_pc_event_id_strings[] = { - "" + "", "SMBIOS", "BIS Certificate", "POST BIOS ", @@ -130,11 +137,12 @@ static const char* tcpa_pc_event_id_strings[] = { "NVRAM", "Option ROM", "Option ROM config", - "Option ROM microcode", + "", + "Option ROM microcode ", "S-CRTM Version", - "S-CRTM Contents", - "S-CRTM POST Contents", - "POST Contents", + "S-CRTM Contents ", + "POST Contents ", + "Table of Devices", }; /* returns pointer to start of pos. entry of tcg log */ @@ -206,7 +214,7 @@ static int get_event_name(char *dest, struct tcpa_event *event, const char *name = ""; char data[40] = ""; int i, n_len = 0, d_len = 0; - u32 event_id; + struct tcpa_pc_event *pc_event; switch(event->event_type) { case PREBOOT: @@ -235,31 +243,32 @@ static int get_event_name(char *dest, struct tcpa_event *event, } break; case EVENT_TAG: - event_id = be32_to_cpu(*((u32 *)event_entry)); + pc_event = (struct tcpa_pc_event *)event_entry; /* ToDo Row data -> Base64 */ - switch (event_id) { + switch (pc_event->event_id) { case SMBIOS: case BIS_CERT: case CMOS: case NVRAM: case OPTION_ROM_EXEC: case OPTION_ROM_CONFIG: - case OPTION_ROM_MICROCODE: case S_CRTM_VERSION: - case S_CRTM_CONTENTS: - case POST_CONTENTS: - name = tcpa_pc_event_id_strings[event_id]; + name = tcpa_pc_event_id_strings[pc_event->event_id]; n_len = strlen(name); break; + /* hash data */ case POST_BIOS_ROM: case ESCD: - name = tcpa_pc_event_id_strings[event_id]; + case OPTION_ROM_MICROCODE: + case S_CRTM_CONTENTS: + case POST_CONTENTS: + name = tcpa_pc_event_id_strings[pc_event->event_id]; n_len = strlen(name); for (i = 0; i < 20; i++) - d_len += sprintf(data, "%02x", - event_entry[8 + i]); + d_len += sprintf(&data[2*i], "%02x", + pc_event->event_data[i]); break; default: break; -- cgit v1.2.2 From 44d7aff035118e8c3993aa3fa05d358d1008e982 Mon Sep 17 00:00:00 2001 From: Seiji Munetoh Date: Tue, 30 May 2006 21:25:52 -0700 Subject: [PATCH] tpm: more bios log parsing fixes From: Seiji Munetoh Change the binary output format to actual ACPI TCPA log structure since the current format does not contain all event-data information that need to verify the PCRs in TPM. tpm_binary_bios_measurements_show() uses get_event_name() to convert the binary event-data to ascii format, and puts them as binary. However, to verify the PCRs, the event-data must be a actual binary event-data used by SHA1 calc. in BIOS. So, I think actual ACPI TCPA log is good for this binary output format. That way, any userland tools easily parse this data with reference to TCG PC specification. Signed-off-by: Seiji Munetoh Acked-by: Kylene Hall Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/char/tpm/tpm_bios.c | 48 ++++----------------------------------------- 1 file changed, 4 insertions(+), 44 deletions(-) (limited to 'drivers') diff --git a/drivers/char/tpm/tpm_bios.c b/drivers/char/tpm/tpm_bios.c index 60380174f245..a611972024e6 100644 --- a/drivers/char/tpm/tpm_bios.c +++ b/drivers/char/tpm/tpm_bios.c @@ -284,53 +284,13 @@ static int get_event_name(char *dest, struct tcpa_event *event, static int tpm_binary_bios_measurements_show(struct seq_file *m, void *v) { + struct tcpa_event *event = v; + char *data = v; + int i; - char *eventname; - char data[4]; - u32 help; - int i, len; - struct tcpa_event *event = (struct tcpa_event *) v; - unsigned char *event_entry = - (unsigned char *) (v + sizeof(struct tcpa_event)); - - eventname = kmalloc(MAX_TEXT_EVENT, GFP_KERNEL); - if (!eventname) { - printk(KERN_ERR "%s: ERROR - No Memory for event name\n ", - __func__); - return -ENOMEM; - } - - /* 1st: PCR used is in little-endian format (4 bytes) */ - help = le32_to_cpu(event->pcr_index); - memcpy(data, &help, 4); - for (i = 0; i < 4; i++) - seq_putc(m, data[i]); - - /* 2nd: SHA1 (20 bytes) */ - for (i = 0; i < 20; i++) - seq_putc(m, event->pcr_value[i]); - - /* 3rd: event type identifier (4 bytes) */ - help = le32_to_cpu(event->event_type); - memcpy(data, &help, 4); - for (i = 0; i < 4; i++) + for (i = 0; i < sizeof(struct tcpa_event) + event->event_size; i++) seq_putc(m, data[i]); - len = 0; - - len += get_event_name(eventname, event, event_entry); - - /* 4th: filename <= 255 + \'0' delimiter */ - if (len > TCG_EVENT_NAME_LEN_MAX) - len = TCG_EVENT_NAME_LEN_MAX; - - for (i = 0; i < len; i++) - seq_putc(m, eventname[i]); - - /* 5th: delimiter */ - seq_putc(m, '\0'); - - kfree(eventname); return 0; } -- cgit v1.2.2 From d61a3ead268084cc271d7b2aa2950fc822a37cf5 Mon Sep 17 00:00:00 2001 From: Corey Minyard Date: Tue, 30 May 2006 21:25:57 -0700 Subject: [PATCH] IPMI: reserve I/O ports separately From: Corey Minyard This patch is pretty important to get in for IPMI, new systems have been changing the way ACPI and IPMI interact, and this works around the problems for now. This is a temporary fix until we get proper ACPI handling in IPMI. Fixed releasing already-allocated regions when a later request fails, and forward-ported it to HEAD. Some BIOSes reserve disjoint I/O regions in their ACPI tables for the IPMI controller. This causes problems when trying to register the entire I/O region. Therefore we must register each I/O port separately. Signed-off-by: Jordan Hargrave Signed-off-by: Matt Domsch Signed-off-by: Corey Minyard Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/char/ipmi/ipmi_si_intf.c | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) (limited to 'drivers') diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index b36eef0e9d19..02a7dd7a8a55 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c @@ -1184,20 +1184,20 @@ static void port_outl(struct si_sm_io *io, unsigned int offset, static void port_cleanup(struct smi_info *info) { unsigned int addr = info->io.addr_data; - int mapsize; + int idx; if (addr) { - mapsize = ((info->io_size * info->io.regspacing) - - (info->io.regspacing - info->io.regsize)); - - release_region (addr, mapsize); + for (idx = 0; idx < info->io_size; idx++) { + release_region(addr + idx * info->io.regspacing, + info->io.regsize); + } } } static int port_setup(struct smi_info *info) { unsigned int addr = info->io.addr_data; - int mapsize; + int idx; if (!addr) return -ENODEV; @@ -1225,16 +1225,22 @@ static int port_setup(struct smi_info *info) return -EINVAL; } - /* Calculate the total amount of memory to claim. This is an - * unusual looking calculation, but it avoids claiming any - * more memory than it has to. It will claim everything - * between the first address to the end of the last full - * register. */ - mapsize = ((info->io_size * info->io.regspacing) - - (info->io.regspacing - info->io.regsize)); - - if (request_region(addr, mapsize, DEVICE_NAME) == NULL) - return -EIO; + /* Some BIOSes reserve disjoint I/O regions in their ACPI + * tables. This causes problems when trying to register the + * entire I/O region. Therefore we must register each I/O + * port separately. + */ + for (idx = 0; idx < info->io_size; idx++) { + if (request_region(addr + idx * info->io.regspacing, + info->io.regsize, DEVICE_NAME) == NULL) { + /* Undo allocations */ + while (idx--) { + release_region(addr + idx * info->io.regspacing, + info->io.regsize); + } + return -EIO; + } + } return 0; } -- cgit v1.2.2 From 760f1fce030ccc620ec430a8aff8fc604e7891ed Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Tue, 30 May 2006 21:26:03 -0700 Subject: [PATCH] revert "swsusp add check for suspension of X controlled devices" From: Andrew Morton Revert commit ff4da2e262d2509fe1bacff70dd00934be569c66. It broke APM suspend, probably because APM doesn't switch back to a VT when suspending. Tracked down by Matt Mackall Rafael sayeth: "It only fixed the theoretical issue that a quick-handed user could switch to X after processes have been frozen and before the devices are suspended. With the current userland suspend tools it shouldn't be necessary." Cc: Pavel Machek Cc: "Rafael J. Wysocki" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/base/power/suspend.c | 5 +---- drivers/char/vt.c | 8 -------- 2 files changed, 1 insertion(+), 12 deletions(-) (limited to 'drivers') diff --git a/drivers/base/power/suspend.c b/drivers/base/power/suspend.c index 662209d3f42d..2a769cc6f5f9 100644 --- a/drivers/base/power/suspend.c +++ b/drivers/base/power/suspend.c @@ -8,7 +8,6 @@ * */ -#include #include #include #include @@ -66,6 +65,7 @@ int suspend_device(struct device * dev, pm_message_t state) return error; } + /** * device_suspend - Save state and stop all devices in system. * @state: Power state to put each device in. @@ -85,9 +85,6 @@ int device_suspend(pm_message_t state) { int error = 0; - if (!is_console_suspend_safe()) - return -EINVAL; - down(&dpm_sem); down(&dpm_list_sem); while (!list_empty(&dpm_active) && error == 0) { diff --git a/drivers/char/vt.c b/drivers/char/vt.c index acc5d47844eb..6c94879e0b99 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c @@ -3238,14 +3238,6 @@ void vcs_scr_writew(struct vc_data *vc, u16 val, u16 *org) } } -int is_console_suspend_safe(void) -{ - /* It is unsafe to suspend devices while X has control of the - * hardware. Make sure we are running on a kernel-controlled console. - */ - return vc_cons[fg_console].d->vc_mode == KD_TEXT; -} - /* * Visible symbols for modules */ -- cgit v1.2.2 From c05b7f3d12b9455d746b69b7078ed34d777f560b Mon Sep 17 00:00:00 2001 From: Rodolfo Giometti Date: Tue, 30 May 2006 21:26:57 -0700 Subject: [PATCH] au1100fb: Fix compilation From: Rodolfo Giometti Fix the following warning on compilation: drivers/video/au1100fb.c: In function `au1100fb_fb_setcolreg': drivers/video/au1100fb.c:219: warning: ISO C90 forbids mixed declarations and code drivers/video/au1100fb.c: In function `au1100fb_fb_pan_display': drivers/video/au1100fb.c:321: warning: ISO C90 forbids mixed declarations and code drivers/video/au1100fb.c: In function `au1100fb_fb_mmap': drivers/video/au1100fb.c:387: warning: ISO C90 forbids mixed declarations and code drivers/video/au1100fb.c: In function `au1100fb_drv_probe': drivers/video/au1100fb.c:471: warning: unsigned int format, long unsigned int arg (arg 2) drivers/video/au1100fb.c: At top level: drivers/video/au1100fb.c:617: warning: initialization from incompatible pointer type drivers/video/au1100fb.c:618: warning: initialization from incompatible pointer type Signed-off-by: Rodolfo Giometti Signed-off-by: Antonino Daplas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/au1100fb.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'drivers') diff --git a/drivers/video/au1100fb.c b/drivers/video/au1100fb.c index 3d04b2def0f1..789450bb0bc9 100644 --- a/drivers/video/au1100fb.c +++ b/drivers/video/au1100fb.c @@ -214,10 +214,13 @@ int au1100fb_setmode(struct au1100fb_device *fbdev) */ int au1100fb_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue, unsigned transp, struct fb_info *fbi) { - struct au1100fb_device *fbdev = to_au1100fb_device(fbi); - u32 *palette = fbdev->regs->lcd_pallettebase; + struct au1100fb_device *fbdev; + u32 *palette; u32 value; + fbdev = to_au1100fb_device(fbi); + palette = fbdev->regs->lcd_pallettebase; + if (regno > (AU1100_LCD_NBR_PALETTE_ENTRIES - 1)) return -EINVAL; @@ -316,9 +319,11 @@ int au1100fb_fb_blank(int blank_mode, struct fb_info *fbi) */ int au1100fb_fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *fbi) { - struct au1100fb_device *fbdev = to_au1100fb_device(fbi); + struct au1100fb_device *fbdev; int dy; + fbdev = to_au1100fb_device(fbi); + print_dbg("fb_pan_display %p %p", var, fbi); if (!var || !fbdev) { @@ -382,10 +387,12 @@ void au1100fb_fb_rotate(struct fb_info *fbi, int angle) */ int au1100fb_fb_mmap(struct fb_info *fbi, struct vm_area_struct *vma) { - struct au1100fb_device *fbdev = to_au1100fb_device(fbi); + struct au1100fb_device *fbdev; unsigned int len; unsigned long start=0, off; + fbdev = to_au1100fb_device(fbi); + if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) { return -EINVAL; } @@ -467,7 +474,7 @@ int au1100fb_drv_probe(struct device *dev) if (!request_mem_region(au1100fb_fix.mmio_start, au1100fb_fix.mmio_len, DRIVER_NAME)) { - print_err("fail to lock memory region at 0x%08x", + print_err("fail to lock memory region at 0x%08lx", au1100fb_fix.mmio_start); return -EBUSY; } @@ -595,13 +602,13 @@ int au1100fb_drv_remove(struct device *dev) return 0; } -int au1100fb_drv_suspend(struct device *dev, u32 state, u32 level) +int au1100fb_drv_suspend(struct device *dev, pm_message_t state) { /* TODO */ return 0; } -int au1100fb_drv_resume(struct device *dev, u32 level) +int au1100fb_drv_resume(struct device *dev) { /* TODO */ return 0; -- cgit v1.2.2 From 8fd66ab852281f9e28e1774c17b49f26c4626fd1 Mon Sep 17 00:00:00 2001 From: Martin Michlmayr Date: Tue, 30 May 2006 21:27:02 -0700 Subject: [PATCH] maxinefb: Fix compilation error From: Martin Michlmayr Fix the following compilation error: CC drivers/video/maxinefb.o drivers/video/maxinefb.c:58: warning: initializer-string for array of chars is too long drivers/video/maxinefb.c:58: warning: (near initialization for \u2018maxinefb_fix.id\u2019) drivers/video/maxinefb.c:110: error: unknown field \u2018fb_get_fix\u2019 specified in initializer drivers/video/maxinefb.c:110: error: \u2018gen_get_fix\u2019 undeclared here (not in a function) drivers/video/maxinefb.c:111: error: unknown field \u2018fb_get_var\u2019 specified in initializer drivers/video/maxinefb.c:111: error: \u2018gen_get_var\u2019 undeclared here (not in a function) make[2]: *** [drivers/video/maxinefb.o] Error 1 Signed-off-by: Martin Michlmayr Signed-off-by: Antonino Daplas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/maxinefb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/video/maxinefb.c b/drivers/video/maxinefb.c index 743e7ad26acc..f85421bf7cb5 100644 --- a/drivers/video/maxinefb.c +++ b/drivers/video/maxinefb.c @@ -55,7 +55,7 @@ static struct fb_var_screeninfo maxinefb_defined = { }; static struct fb_fix_screeninfo maxinefb_fix = { - .id = "Maxine onboard graphics 1024x768x8", + .id = "Maxine", .smem_len = (1024*768), .type = FB_TYPE_PACKED_PIXELS, .visual = FB_VISUAL_PSEUDOCOLOR, @@ -107,8 +107,6 @@ static int maxinefb_setcolreg(unsigned regno, unsigned red, unsigned green, static struct fb_ops maxinefb_ops = { .owner = THIS_MODULE, - .fb_get_fix = gen_get_fix, - .fb_get_var = gen_get_var, .fb_setcolreg = maxinefb_setcolreg, .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, -- cgit v1.2.2 From a835fa798ddfbfe4c63ff5e22c93fa5d24c95f7b Mon Sep 17 00:00:00 2001 From: Jeremy Higdon Date: Tue, 30 May 2006 21:27:07 -0700 Subject: [PATCH] sgiioc4: use mmio ops instead of port io From: Jeremy Higdon This patch fixes a bug in sgiioc4 where it was using the default IDE port I/O operations instead of MMIO. The IDE part of the IOC4 chip uses MMIO to map the chip registers. Unfortunately, the sgiioc4 driver uses the default port IO operations, which happens to have worked for the past few years. That's about to change, however, thus this change from inX/outX to readX/writeX. Signed-off-by: Jeremy Higdon Cc: Bartlomiej Zolnierkiewicz Cc: Alan Cox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/ide/pci/sgiioc4.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'drivers') diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c index 43b96e298363..27c9eb989a9a 100644 --- a/drivers/ide/pci/sgiioc4.c +++ b/drivers/ide/pci/sgiioc4.c @@ -345,17 +345,17 @@ sgiioc4_resetproc(ide_drive_t * drive) static u8 sgiioc4_INB(unsigned long port) { - u8 reg = (u8) inb(port); + u8 reg = (u8) readb((void __iomem *) port); if ((port & 0xFFF) == 0x11C) { /* Status register of IOC4 */ if (reg & 0x51) { /* Not busy...check for interrupt */ unsigned long other_ir = port - 0x110; - unsigned int intr_reg = (u32) inl(other_ir); + unsigned int intr_reg = (u32) readl((void __iomem *) other_ir); /* Clear the Interrupt, Error bits on the IOC4 */ if (intr_reg & 0x03) { - outl(0x03, other_ir); - intr_reg = (u32) inl(other_ir); + writel(0x03, (void __iomem *) other_ir); + intr_reg = (u32) readl((void __iomem *) other_ir); } } } @@ -606,6 +606,12 @@ ide_init_sgiioc4(ide_hwif_t * hwif) hwif->ide_dma_host_off = &sgiioc4_ide_dma_host_off; hwif->ide_dma_lostirq = &sgiioc4_ide_dma_lostirq; hwif->ide_dma_timeout = &__ide_dma_timeout; + + /* + * The IOC4 uses MMIO rather than Port IO. + * It also needs special workarounds for INB. + */ + default_hwif_mmiops(hwif); hwif->INB = &sgiioc4_INB; } @@ -743,6 +749,6 @@ ioc4_ide_exit(void) module_init(ioc4_ide_init); module_exit(ioc4_ide_exit); -MODULE_AUTHOR("Aniket Malatpure - Silicon Graphics Inc. (SGI)"); +MODULE_AUTHOR("Aniket Malatpure/Jeremy Higdon"); MODULE_DESCRIPTION("IDE PCI driver module for SGI IOC4 Base-IO Card"); MODULE_LICENSE("GPL"); -- cgit v1.2.2 From c331eb04b995ad276a7ece4608326f1db4e137d8 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Tue, 30 May 2006 21:27:13 -0700 Subject: [PATCH] md: Fix badness in sysfs_notify caused by md_new_event From: NeilBrown If an error is reported by a drive in a RAID array (which is done via bi_end_io - in interrupt context), we call md_error and md_new_event which calls sysfs_notify. However sysfs_notify grabs a mutex and so cannot be called in interrupt context. This patch just creates a variant of md_new_event which avoids the sysfs call, and uses that. A better fix for later is to arrange for the event to be called from user-context. Note: avoiding the sysfs call isn't a problem as an error will not, by itself, modify the sync_action attribute. (We do still need to wake_up(&md_event_waiters) as an error by itself will modify /proc/mdstat). Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/md/md.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/md/md.c b/drivers/md/md.c index ec802913f977..f19b874753a9 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -167,6 +167,15 @@ void md_new_event(mddev_t *mddev) } EXPORT_SYMBOL_GPL(md_new_event); +/* Alternate version that can be called from interrupts + * when calling sysfs_notify isn't needed. + */ +void md_new_event_inintr(mddev_t *mddev) +{ + atomic_inc(&md_event_count); + wake_up(&md_event_waiters); +} + /* * Enables to iterate over all existing md arrays * all_mddevs_lock protects this list. @@ -4149,7 +4158,7 @@ void md_error(mddev_t *mddev, mdk_rdev_t *rdev) set_bit(MD_RECOVERY_INTR, &mddev->recovery); set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); md_wakeup_thread(mddev->thread); - md_new_event(mddev); + md_new_event_inintr(mddev); } /* seq_file implementation /proc/mdstat */ -- cgit v1.2.2 From f52359622fa25783cf1a08c0772048d2ed1a7434 Mon Sep 17 00:00:00 2001 From: Bryan Holty Date: Wed, 22 Mar 2006 06:35:39 -0600 Subject: [SCSI] scsi_lib.c: properly count the number of pages in scsi_req_map_sg() The calculation of nr_pages in scsi_req_map_sg() doesn't account for the fact that the first page could have an offset that pushes the end of the buffer onto a new page. Signed-off-by: Bryan Holty Signed-off-by: James Bottomley --- drivers/scsi/scsi_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 764a8b375ead..faee4757c03a 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -367,7 +367,7 @@ static int scsi_req_map_sg(struct request *rq, struct scatterlist *sgl, int nsegs, unsigned bufflen, gfp_t gfp) { struct request_queue *q = rq->q; - int nr_pages = (bufflen + PAGE_SIZE - 1) >> PAGE_SHIFT; + int nr_pages = (bufflen + sgl[0].offset + PAGE_SIZE - 1) >> PAGE_SHIFT; unsigned int data_len = 0, len, bytes, off; struct page *page; struct bio *bio = NULL; -- cgit v1.2.2 From 1617406a763870a84ffe6bba3659f30f96ac4a61 Mon Sep 17 00:00:00 2001 From: Florin Malita Date: Wed, 24 May 2006 21:21:31 -0400 Subject: [PATCH] pcmcia: missing pcmcia_get_socket() result check The result of pcmcia_get_socket() may be NULL but ds_event() uses it without checking. Coverity CID: 436. Signed-off-by: Florin Malita Signed-off-by: Dominik Brodowski --- drivers/pcmcia/ds.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers') diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 48d3b3d30c21..74b3124e8247 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c @@ -1143,6 +1143,12 @@ static int ds_event(struct pcmcia_socket *skt, event_t event, int priority) { struct pcmcia_socket *s = pcmcia_get_socket(skt); + if (!s) { + printk(KERN_ERR "PCMCIA obtaining reference to socket %p " \ + "failed, event 0x%x lost!\n", skt, event); + return -ENODEV; + } + ds_dbg(1, "ds_event(0x%06x, %d, 0x%p)\n", event, priority, skt); -- cgit v1.2.2 From 2b0dd802ba1ff9b7001f5f9bd9b4d192a4aabf81 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Thu, 1 Jun 2006 18:29:20 +0200 Subject: [PATCH] pcmcia: fix zeroing of cm4000_cs.c data Fix the incorrect calculation of how much to zero out in struct cm4000_dev on device initialization. Signed-off-by: Dominik Brodowski --- drivers/char/pcmcia/cm4000_cs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c index 128b2632512d..eab5394da666 100644 --- a/drivers/char/pcmcia/cm4000_cs.c +++ b/drivers/char/pcmcia/cm4000_cs.c @@ -149,7 +149,7 @@ struct cm4000_dev { #define ZERO_DEV(dev) \ memset(&dev->atr_csum,0, \ sizeof(struct cm4000_dev) - \ - /*link*/ sizeof(struct pcmcia_device) - \ + /*link*/ sizeof(struct pcmcia_device *) - \ /*node*/ sizeof(dev_node_t) - \ /*atr*/ MAX_ATR*sizeof(char) - \ /*rbuf*/ 512*sizeof(char) - \ -- cgit v1.2.2 From 092d01e260da628b01d4229c31a296111e3cd97a Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sun, 4 Jun 2006 17:40:58 +0100 Subject: [MMC] Prevent au1xmmc.c breakage on non-Au1200 Alchemy The driver is selectable on other than Au1200 Alchemy systems but won't build nor work - there is no MMC hw. Signed-off-by: Ralf Baechle Signed-off-by: Russell King --- drivers/mmc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig index 003b077c2324..45bcf098e762 100644 --- a/drivers/mmc/Kconfig +++ b/drivers/mmc/Kconfig @@ -84,7 +84,7 @@ config MMC_WBSD config MMC_AU1X tristate "Alchemy AU1XX0 MMC Card Interface support" - depends on SOC_AU1X00 && MMC + depends on MMC && SOC_AU1200 help This selects the AMD Alchemy(R) Multimedia card interface. If you have a Alchemy platform with a MMC slot, say Y or M here. -- cgit v1.2.2 From 959eb39297e8c82f61fbfc283ad4ff11c883bf1e Mon Sep 17 00:00:00 2001 From: Eli Cohen Date: Mon, 5 Jun 2006 09:51:36 -0700 Subject: IPoIB: Fix AH leak at interface down When ipoib_stop() is called it first calls netif_stop_queue() to stop the kernel from passing more packets to the network driver. However, the completion handler may call netif_wake_queue() re-enabling packet transfer. This might result in leaks (we see AH leaks which we think can be attributed to this bug) as new packets get posted while the interface is going down. Signed-off-by: Eli Cohen Signed-off-by: Michael Tsirkin Signed-off-by: Roland Dreier --- drivers/infiniband/ulp/ipoib/ipoib_ib.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers') diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c index a54da42849ae..8406839b91cf 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c @@ -275,6 +275,7 @@ static void ipoib_ib_handle_wc(struct net_device *dev, spin_lock_irqsave(&priv->tx_lock, flags); ++priv->tx_tail; if (netif_queue_stopped(dev) && + test_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags) && priv->tx_head - priv->tx_tail <= ipoib_sendq_size >> 1) netif_wake_queue(dev); spin_unlock_irqrestore(&priv->tx_lock, flags); -- cgit v1.2.2 From 6f258910733a8dbde368acc2ede4b8184ff0e09a Mon Sep 17 00:00:00 2001 From: Florin Malita Date: Sun, 4 Jun 2006 02:51:26 -0700 Subject: [PATCH] nmclan_cs: dereferencing skb after netif_rx() From: Florin Malita The skb may be gone after netif_rx(), we can't use 'skb->len' to update the stats. 'pkt_len' should work instead. Coverity CID: 911. Signed-off-by: Florin Malita Cc: Dominik Brodowski Acked-by: Jeff Garzik Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/net/pcmcia/nmclan_cs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c index 4260c2128f47..a8f6bfc96fd2 100644 --- a/drivers/net/pcmcia/nmclan_cs.c +++ b/drivers/net/pcmcia/nmclan_cs.c @@ -1204,7 +1204,7 @@ static int mace_rx(struct net_device *dev, unsigned char RxCnt) dev->last_rx = jiffies; lp->linux_stats.rx_packets++; - lp->linux_stats.rx_bytes += skb->len; + lp->linux_stats.rx_bytes += pkt_len; outb(0xFF, ioaddr + AM2150_RCV_NEXT); /* skip to next frame */ continue; } else { -- cgit v1.2.2 From e0ec574987a3301f7767750bb6e8be47d6323bfa Mon Sep 17 00:00:00 2001 From: Cornelia Huck Date: Sun, 4 Jun 2006 02:51:27 -0700 Subject: [PATCH] s390: irb memcpy argument swap From: Cornelia Huck Swapped memcpy arguments in ccw_device_irq() when doing basic sense after unsolicited interrupt. Signed-off-by: Cornelia Huck Signed-off-by: Martin Schwidefsky Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/s390/cio/device_fsm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c index 180b3bf8b90d..49ec562d7f60 100644 --- a/drivers/s390/cio/device_fsm.c +++ b/drivers/s390/cio/device_fsm.c @@ -749,7 +749,7 @@ ccw_device_irq(struct ccw_device *cdev, enum dev_event dev_event) /* Unit check but no sense data. Need basic sense. */ if (ccw_device_do_sense(cdev, irb) != 0) goto call_handler_unsol; - memcpy(irb, &cdev->private->irb, sizeof(struct irb)); + memcpy(&cdev->private->irb, irb, sizeof(struct irb)); cdev->private->state = DEV_STATE_W4SENSE; cdev->private->intparm = 0; return; -- cgit v1.2.2 From 4ae9538dd02824257e8e72c053c69ad6680aba04 Mon Sep 17 00:00:00 2001 From: Peter Oberparleiter Date: Sun, 4 Jun 2006 02:51:28 -0700 Subject: [PATCH] s390: cio non-unique path group ids From: Peter Oberparleiter The path grouping can fail due to non-unique pathgroup-IDs. The source for the CPU-ID part of the ID was incorrectly specified on 64 bit systems. Additionally, the length of the ID was too large due to incorrect data packing declaration. Fix CPU-ID lowcore address and add missing packing declaration. Signed-off-by: Peter Oberparleiter Signed-off-by: Martin Schwidefsky Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/s390/cio/css.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/s390/cio/css.h b/drivers/s390/cio/css.h index 74a257b23383..e210f89a2449 100644 --- a/drivers/s390/cio/css.h +++ b/drivers/s390/cio/css.h @@ -45,11 +45,11 @@ struct pgid { union { __u8 fc; /* SPID function code */ struct path_state ps; /* SNID path state */ - } inf; + } __attribute__ ((packed)) inf; union { __u32 cpu_addr : 16; /* CPU address */ struct extended_cssid ext_cssid; - } pgid_high; + } __attribute__ ((packed)) pgid_high; __u32 cpu_id : 24; /* CPU identification */ __u32 cpu_model : 16; /* CPU model */ __u32 tod_high; /* high word TOD clock */ -- cgit v1.2.2 From 0674d594ad8e0856243536c0bcc22e4583554bfb Mon Sep 17 00:00:00 2001 From: Zachary Amsden Date: Sun, 4 Jun 2006 02:51:38 -0700 Subject: [PATCH] Implement get / set tso for forcedeth driver From: Zachary Amsden Signed-off-by: Zachary Amsden Cc: Ayaz Abdulla Cc: Manfred Spraul Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/net/forcedeth.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'drivers') diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index 705e1229d89d..feb5b223cd60 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c @@ -2615,6 +2615,18 @@ static int nv_nway_reset(struct net_device *dev) return ret; } +#ifdef NETIF_F_TSO +static int nv_set_tso(struct net_device *dev, u32 value) +{ + struct fe_priv *np = netdev_priv(dev); + + if ((np->driver_data & DEV_HAS_CHECKSUM)) + return ethtool_op_set_tso(dev, value); + else + return value ? -EOPNOTSUPP : 0; +} +#endif + static struct ethtool_ops ops = { .get_drvinfo = nv_get_drvinfo, .get_link = ethtool_op_get_link, @@ -2626,6 +2638,10 @@ static struct ethtool_ops ops = { .get_regs = nv_get_regs, .nway_reset = nv_nway_reset, .get_perm_addr = ethtool_op_get_perm_addr, +#ifdef NETIF_F_TSO + .get_tso = ethtool_op_get_tso, + .set_tso = nv_set_tso +#endif }; static void nv_vlan_rx_register(struct net_device *dev, struct vlan_group *grp) -- cgit v1.2.2 From 829a1985e732698ee98def146410e6e9f532781f Mon Sep 17 00:00:00 2001 From: Stefan Richter Date: Sun, 4 Jun 2006 02:51:40 -0700 Subject: [PATCH] sbp2: fix check of return value of hpsb_allocate_and_register_addrspace() From: Stefan Richter I added a failure check in patch "sbp2: variable status FIFO address (fix login timeout)" --- alas for a wrong error value. This is a bug since Linux 2.6.16. Leads to NULL pointer dereference if the call failed, and bogus failure handling if call succeeded. Signed-off-by: Stefan Richter Cc: Cc: Ben Collins Cc: Jody McIntyre Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/ieee1394/sbp2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c index 8a23fb54c693..5413dc43b9f1 100644 --- a/drivers/ieee1394/sbp2.c +++ b/drivers/ieee1394/sbp2.c @@ -845,7 +845,7 @@ static struct scsi_id_instance_data *sbp2_alloc_device(struct unit_directory *ud &sbp2_highlevel, ud->ne->host, &sbp2_ops, sizeof(struct sbp2_status_block), sizeof(quadlet_t), 0x010000000000ULL, CSR1212_ALL_SPACE_END); - if (!scsi_id->status_fifo_addr) { + if (scsi_id->status_fifo_addr == ~0ULL) { SBP2_ERR("failed to allocate status FIFO address range"); goto failed_alloc; } -- cgit v1.2.2 From 67f672f61bb75e74805046e4a301f4923b0ef753 Mon Sep 17 00:00:00 2001 From: Rune Torgersen Date: Sun, 4 Jun 2006 02:51:41 -0700 Subject: [PATCH] sata_sil24: SII3124 sata driver endian problem From: "Rune Torgersen" Fix an endian issue in the sil24 driver. Signed-off-by: Rune Torgersen Acked-by: Jeff Garzik Cc: Tejun Heo Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/scsi/sata_sil24.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/scsi/sata_sil24.c b/drivers/scsi/sata_sil24.c index f7264fd611c2..cb9082fd7e2f 100644 --- a/drivers/scsi/sata_sil24.c +++ b/drivers/scsi/sata_sil24.c @@ -454,7 +454,7 @@ static int sil24_softreset(struct ata_port *ap, int verbose, */ msleep(10); - prb->ctrl = PRB_CTRL_SRST; + prb->ctrl = cpu_to_le16(PRB_CTRL_SRST); prb->fis[1] = 0; /* no PM yet */ writel((u32)paddr, port + PORT_CMD_ACTIVATE); @@ -551,9 +551,9 @@ static void sil24_qc_prep(struct ata_queued_cmd *qc) if (qc->tf.protocol != ATA_PROT_ATAPI_NODATA) { if (qc->tf.flags & ATA_TFLAG_WRITE) - prb->ctrl = PRB_CTRL_PACKET_WRITE; + prb->ctrl = cpu_to_le16(PRB_CTRL_PACKET_WRITE); else - prb->ctrl = PRB_CTRL_PACKET_READ; + prb->ctrl = cpu_to_le16(PRB_CTRL_PACKET_READ); } else prb->ctrl = 0; -- cgit v1.2.2 From 2d7b20c1884777e66009be1a533641c19c4705f6 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sun, 4 Jun 2006 02:51:42 -0700 Subject: [PATCH] m48t86: ia64 build fix From: Andrew Morton drivers/rtc/rtc-m48t86.c: In function `m48t86_rtc_read_time': drivers/rtc/rtc-m48t86.c:51: error: structure has no member named `ia64_mv' drivers/rtc/rtc-m48t86.c:55: error: structure has no member named `ia64_mv' drivers/rtc/rtc-m48t86.c:56: error: structure has no member named `ia64_mv' drivers/rtc/rtc-m48t86.c:57: error: structure has no member named `ia64_mv' drivers/rtc/rtc-m48t86.c:58: error: structure has no member named `ia64_mv' drivers/rtc/rtc-m48t86.c:60: error: structure has no member named `ia64_mv' readb() and writeb() are macros on ia64. Cc: Alessandro Zummo Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/rtc/rtc-m48t86.c | 72 ++++++++++++++++++++++++------------------------ 1 file changed, 36 insertions(+), 36 deletions(-) (limited to 'drivers') diff --git a/drivers/rtc/rtc-m48t86.c b/drivers/rtc/rtc-m48t86.c index f6e7ee04f3dc..8c0d1a6739ad 100644 --- a/drivers/rtc/rtc-m48t86.c +++ b/drivers/rtc/rtc-m48t86.c @@ -48,33 +48,33 @@ static int m48t86_rtc_read_time(struct device *dev, struct rtc_time *tm) struct platform_device *pdev = to_platform_device(dev); struct m48t86_ops *ops = pdev->dev.platform_data; - reg = ops->readb(M48T86_REG_B); + reg = ops->readbyte(M48T86_REG_B); if (reg & M48T86_REG_B_DM) { /* data (binary) mode */ - tm->tm_sec = ops->readb(M48T86_REG_SEC); - tm->tm_min = ops->readb(M48T86_REG_MIN); - tm->tm_hour = ops->readb(M48T86_REG_HOUR) & 0x3F; - tm->tm_mday = ops->readb(M48T86_REG_DOM); + tm->tm_sec = ops->readbyte(M48T86_REG_SEC); + tm->tm_min = ops->readbyte(M48T86_REG_MIN); + tm->tm_hour = ops->readbyte(M48T86_REG_HOUR) & 0x3F; + tm->tm_mday = ops->readbyte(M48T86_REG_DOM); /* tm_mon is 0-11 */ - tm->tm_mon = ops->readb(M48T86_REG_MONTH) - 1; - tm->tm_year = ops->readb(M48T86_REG_YEAR) + 100; - tm->tm_wday = ops->readb(M48T86_REG_DOW); + tm->tm_mon = ops->readbyte(M48T86_REG_MONTH) - 1; + tm->tm_year = ops->readbyte(M48T86_REG_YEAR) + 100; + tm->tm_wday = ops->readbyte(M48T86_REG_DOW); } else { /* bcd mode */ - tm->tm_sec = BCD2BIN(ops->readb(M48T86_REG_SEC)); - tm->tm_min = BCD2BIN(ops->readb(M48T86_REG_MIN)); - tm->tm_hour = BCD2BIN(ops->readb(M48T86_REG_HOUR) & 0x3F); - tm->tm_mday = BCD2BIN(ops->readb(M48T86_REG_DOM)); + tm->tm_sec = BCD2BIN(ops->readbyte(M48T86_REG_SEC)); + tm->tm_min = BCD2BIN(ops->readbyte(M48T86_REG_MIN)); + tm->tm_hour = BCD2BIN(ops->readbyte(M48T86_REG_HOUR) & 0x3F); + tm->tm_mday = BCD2BIN(ops->readbyte(M48T86_REG_DOM)); /* tm_mon is 0-11 */ - tm->tm_mon = BCD2BIN(ops->readb(M48T86_REG_MONTH)) - 1; - tm->tm_year = BCD2BIN(ops->readb(M48T86_REG_YEAR)) + 100; - tm->tm_wday = BCD2BIN(ops->readb(M48T86_REG_DOW)); + tm->tm_mon = BCD2BIN(ops->readbyte(M48T86_REG_MONTH)) - 1; + tm->tm_year = BCD2BIN(ops->readbyte(M48T86_REG_YEAR)) + 100; + tm->tm_wday = BCD2BIN(ops->readbyte(M48T86_REG_DOW)); } /* correct the hour if the clock is in 12h mode */ if (!(reg & M48T86_REG_B_H24)) - if (ops->readb(M48T86_REG_HOUR) & 0x80) + if (ops->readbyte(M48T86_REG_HOUR) & 0x80) tm->tm_hour += 12; return 0; @@ -86,35 +86,35 @@ static int m48t86_rtc_set_time(struct device *dev, struct rtc_time *tm) struct platform_device *pdev = to_platform_device(dev); struct m48t86_ops *ops = pdev->dev.platform_data; - reg = ops->readb(M48T86_REG_B); + reg = ops->readbyte(M48T86_REG_B); /* update flag and 24h mode */ reg |= M48T86_REG_B_SET | M48T86_REG_B_H24; - ops->writeb(reg, M48T86_REG_B); + ops->writebyte(reg, M48T86_REG_B); if (reg & M48T86_REG_B_DM) { /* data (binary) mode */ - ops->writeb(tm->tm_sec, M48T86_REG_SEC); - ops->writeb(tm->tm_min, M48T86_REG_MIN); - ops->writeb(tm->tm_hour, M48T86_REG_HOUR); - ops->writeb(tm->tm_mday, M48T86_REG_DOM); - ops->writeb(tm->tm_mon + 1, M48T86_REG_MONTH); - ops->writeb(tm->tm_year % 100, M48T86_REG_YEAR); - ops->writeb(tm->tm_wday, M48T86_REG_DOW); + ops->writebyte(tm->tm_sec, M48T86_REG_SEC); + ops->writebyte(tm->tm_min, M48T86_REG_MIN); + ops->writebyte(tm->tm_hour, M48T86_REG_HOUR); + ops->writebyte(tm->tm_mday, M48T86_REG_DOM); + ops->writebyte(tm->tm_mon + 1, M48T86_REG_MONTH); + ops->writebyte(tm->tm_year % 100, M48T86_REG_YEAR); + ops->writebyte(tm->tm_wday, M48T86_REG_DOW); } else { /* bcd mode */ - ops->writeb(BIN2BCD(tm->tm_sec), M48T86_REG_SEC); - ops->writeb(BIN2BCD(tm->tm_min), M48T86_REG_MIN); - ops->writeb(BIN2BCD(tm->tm_hour), M48T86_REG_HOUR); - ops->writeb(BIN2BCD(tm->tm_mday), M48T86_REG_DOM); - ops->writeb(BIN2BCD(tm->tm_mon + 1), M48T86_REG_MONTH); - ops->writeb(BIN2BCD(tm->tm_year % 100), M48T86_REG_YEAR); - ops->writeb(BIN2BCD(tm->tm_wday), M48T86_REG_DOW); + ops->writebyte(BIN2BCD(tm->tm_sec), M48T86_REG_SEC); + ops->writebyte(BIN2BCD(tm->tm_min), M48T86_REG_MIN); + ops->writebyte(BIN2BCD(tm->tm_hour), M48T86_REG_HOUR); + ops->writebyte(BIN2BCD(tm->tm_mday), M48T86_REG_DOM); + ops->writebyte(BIN2BCD(tm->tm_mon + 1), M48T86_REG_MONTH); + ops->writebyte(BIN2BCD(tm->tm_year % 100), M48T86_REG_YEAR); + ops->writebyte(BIN2BCD(tm->tm_wday), M48T86_REG_DOW); } /* update ended */ reg &= ~M48T86_REG_B_SET; - ops->writeb(reg, M48T86_REG_B); + ops->writebyte(reg, M48T86_REG_B); return 0; } @@ -125,12 +125,12 @@ static int m48t86_rtc_proc(struct device *dev, struct seq_file *seq) struct platform_device *pdev = to_platform_device(dev); struct m48t86_ops *ops = pdev->dev.platform_data; - reg = ops->readb(M48T86_REG_B); + reg = ops->readbyte(M48T86_REG_B); seq_printf(seq, "mode\t\t: %s\n", (reg & M48T86_REG_B_DM) ? "binary" : "bcd"); - reg = ops->readb(M48T86_REG_D); + reg = ops->readbyte(M48T86_REG_D); seq_printf(seq, "battery\t\t: %s\n", (reg & M48T86_REG_D_VRT) ? "ok" : "exhausted"); @@ -157,7 +157,7 @@ static int __devinit m48t86_rtc_probe(struct platform_device *dev) platform_set_drvdata(dev, rtc); /* read battery status */ - reg = ops->readb(M48T86_REG_D); + reg = ops->readbyte(M48T86_REG_D); dev_info(&dev->dev, "battery %s\n", (reg & M48T86_REG_D_VRT) ? "ok" : "exhausted"); -- cgit v1.2.2 From 92cd6eeea62e235fcb6634d87d1572c3da59f088 Mon Sep 17 00:00:00 2001 From: Matt Mackall Date: Mon, 5 Jun 2006 15:04:37 -0700 Subject: [NETCONSOLE]: Clean up initcall warning. From: Matt Mackall netconsole is being wrong here. If it wasn't enabled there's no error. Signed-off-by: Andrew Morton Signed-off-by: David S. Miller --- drivers/net/netconsole.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index 66e74f740261..bf58db29e2ed 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c @@ -107,7 +107,7 @@ static int init_netconsole(void) if(!configured) { printk("netconsole: not configured, aborting\n"); - return -EINVAL; + return 0; } if(netpoll_setup(&np)) -- cgit v1.2.2 From 9bc18091a5e44a368827f539289b99788eb27d4e Mon Sep 17 00:00:00 2001 From: Florin Malita Date: Mon, 5 Jun 2006 15:34:33 -0700 Subject: [PPPOE]: Missing result check in __pppoe_xmit(). skb_clone() may fail, we should check the result. Coverity CID: 1215. Signed-off-by: Florin Malita Signed-off-by: Andrew Morton Signed-off-by: David S. Miller --- drivers/net/pppoe.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers') diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c index 475dc930380f..0d101a18026a 100644 --- a/drivers/net/pppoe.c +++ b/drivers/net/pppoe.c @@ -861,6 +861,9 @@ static int __pppoe_xmit(struct sock *sk, struct sk_buff *skb) * give dev_queue_xmit something it can free. */ skb2 = skb_clone(skb, GFP_ATOMIC); + + if (skb2 == NULL) + goto abort; } ph = (struct pppoe_hdr *) skb_push(skb2, sizeof(struct pppoe_hdr)); -- cgit v1.2.2