* Re: [e1000 debug] KERNEL: assertion (!sk_forward_alloc) failed...
From: Phil Oester @ 2006-04-03 21:39 UTC (permalink / raw)
To: Mark Nipper
Cc: Herbert Xu, Boris B. Zhmurov, David S. Miller, jesse.brandeburg,
jrlundgren, cat, djani22, yoseph.basri, mykleb, olel, michal,
chris, netdev, jesse.brandeburg, E1000-devel, Andi Kleen,
Jeff Garzik
In-Reply-To: <20060403210123.GA27698@king.bitgnome.net>
On Mon, Apr 03, 2006 at 04:01:23PM -0500, Mark Nipper wrote:
> After three days and some hours, I finally saw another
> event:
Ack, same here. Looked hopeful, but finally saw the error today.
Phil
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
^ permalink raw reply
* Re: [e1000 debug] KERNEL: assertion (!sk_forward_alloc) failed...
From: Boris B. Zhmurov @ 2006-04-03 22:00 UTC (permalink / raw)
To: Phil Oester
Cc: Mark Nipper, Herbert Xu, David S. Miller, jesse.brandeburg,
jrlundgren, cat, djani22, yoseph.basri, mykleb, olel, michal,
chris, netdev, jesse.brandeburg, E1000-devel, Andi Kleen,
Jeff Garzik
In-Reply-To: <20060403213907.GA32406@linuxace.com>
Hello, Phil Oester.
On 04.04.2006 01:39 you said the following:
> On Mon, Apr 03, 2006 at 04:01:23PM -0500, Mark Nipper wrote:
>
>> After three days and some hours, I finally saw another
>>event:
>
>
> Ack, same here. Looked hopeful, but finally saw the error today.
>
> Phil
[root@msk4 ~]# dmesg |grep assertion |wc -l
176
[root@msk4 ~]# uptime
02:00:01 up 3 days, 7:31, 2 users, load average: 1.32, 0.59, 0.41
--
Boris B. Zhmurov
mailto: bb@kernelpanic.ru
"wget http://kernelpanic.ru/bb_public_key.pgp -O - | gpg --import"
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
^ permalink raw reply
* [RFC: 2.6 patch] remove drivers/net/hydra.h
From: Adrian Bunk @ 2006-04-04 16:29 UTC (permalink / raw)
To: Ciaran Farrell; +Cc: linux-kernel, netdev, jgarzik, linux-m68k
In-Reply-To: <200604041528.00142.ciaranfarrell@babelworx.net>
On Tue, Apr 04, 2006 at 03:27:59PM +0200, Ciaran Farrell wrote:
> We were discussing this topic again and thought it should be reported here. As
> you are probably aware, the file
>
> linux-2.6.16.tar.bz2/linux-2.6.16/drivers/net/hydra.h
>
> contains a BSD 4 license.
>...
The interesting point is that the file seems to be complete unused.
Are there any objections against the patch below to simply remove it?
> cheers
>
> CFarrell
cu
Adrian
<-- snip -->
This patch removes drivers/net/hydra.h that is both unused and covered
by a 4 clause BSD licence (not by the UCB).
Signed-off-by: Adrian Bunk <bunk@stusta.de>
---
drivers/net/hydra.h | 177 --------------------------------------------
1 file changed, 177 deletions(-)
--- linux-2.6.17-rc1-mm1-full/drivers/net/hydra.h 2006-03-20 06:53:29.000000000 +0100
+++ /dev/null 2006-02-12 01:05:26.000000000 +0100
@@ -1,177 +0,0 @@
-/* $Linux: hydra.h,v 1.0 1994/10/26 02:03:47 cgd Exp $ */
-
-/*
- * Copyright (c) 1994 Timo Rossi
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Timo Rossi
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * The Hydra Systems card uses the National Semiconductor
- * 8390 NIC (Network Interface Controller) chip, located
- * at card base address + 0xffe1. NIC registers are accessible
- * only at odd byte addresses, so the register offsets must
- * be multiplied by two.
- *
- * Card address PROM is located at card base + 0xffc0 (even byte addresses)
- *
- * RAM starts at the card base address, and is 16K or 64K.
- * The current Amiga NetBSD hydra driver is hardwired for 16K.
- * It seems that the RAM should be accessed as words or longwords only.
- *
- */
-
-/* adapted for Linux by Topi Kanerva 03/29/95
- with original author's permission */
-
-#define HYDRA_NIC_BASE 0xffe1
-
-/* Page0 registers */
-
-#define NIC_CR 0 /* Command register */
-#define NIC_PSTART (1*2) /* Page start (write) */
-#define NIC_PSTOP (2*2) /* Page stop (write) */
-#define NIC_BNDRY (3*2) /* Boundary pointer */
-#define NIC_TSR (4*2) /* Transmit status (read) */
-#define NIC_TPSR (4*2) /* Transmit page start (write) */
-#define NIC_NCR (5*2) /* Number of collisions, read */
-#define NIC_TBCR0 (5*2) /* Transmit byte count low (write) */
-#define NIC_FIFO (6*2) /* FIFO reg. (read) */
-#define NIC_TBCR1 (6*2) /* Transmit byte count high (write) */
-#define NIC_ISR (7*2) /* Interrupt status register */
-#define NIC_RBCR0 (0xa*2) /* Remote byte count low (write) */
-#define NIC_RBCR1 (0xb*2) /* Remote byte count high (write) */
-#define NIC_RSR (0xc*2) /* Receive status (read) */
-#define NIC_RCR (0xc*2) /* Receive config (write) */
-#define NIC_CNTR0 (0xd*2) /* Frame alignment error count (read) */
-#define NIC_TCR (0xd*2) /* Transmit config (write) */
-#define NIC_CNTR1 (0xe*2) /* CRC error counter (read) */
-#define NIC_DCR (0xe*2) /* Data config (write) */
-#define NIC_CNTR2 (0xf*2) /* missed packet counter (read) */
-#define NIC_IMR (0xf*2) /* Interrupt mask reg. (write) */
-
-/* Page1 registers */
-
-#define NIC_PAR0 (1*2) /* Physical address */
-#define NIC_PAR1 (2*2)
-#define NIC_PAR2 (3*2)
-#define NIC_PAR3 (4*2)
-#define NIC_PAR4 (5*2)
-#define NIC_PAR5 (6*2)
-#define NIC_CURR (7*2) /* Current RX ring-buffer page */
-#define NIC_MAR0 (8*2) /* Multicast address */
-#define NIC_MAR1 (9*2)
-#define NIC_MAR2 (0xa*2)
-#define NIC_MAR3 (0xb*2)
-#define NIC_MAR4 (0xc*2)
-#define NIC_MAR5 (0xd*2)
-#define NIC_MAR6 (0xe*2)
-#define NIC_MAR7 (0xf*2)
-
-/* Command register definitions */
-
-#define CR_STOP 0x01 /* Stop -- software reset command */
-#define CR_START 0x02 /* Start */
-#define CR_TXP 0x04 /* Transmit packet */
-
-#define CR_RD0 0x08 /* Remote DMA cmd */
-#define CR_RD1 0x10
-#define CR_RD2 0x20
-
-#define CR_NODMA CR_RD2
-
-#define CR_PS0 0x40 /* Page select */
-#define CR_PS1 0x80
-
-#define CR_PAGE0 0
-#define CR_PAGE1 CR_PS0
-#define CR_PAGE2 CR_PS1
-
-/* Interrupt status reg. definitions */
-
-#define ISR_PRX 0x01 /* Packet received without errors */
-#define ISR_PTX 0x02 /* Packet transmitted without errors */
-#define ISR_RXE 0x04 /* Receive error */
-#define ISR_TXE 0x08 /* Transmit error */
-#define ISR_OVW 0x10 /* Ring buffer overrun */
-#define ISR_CNT 0x20 /* Counter overflow */
-#define ISR_RDC 0x40 /* Remote DMA compile */
-#define ISR_RST 0x80 /* Reset status */
-
-/* Data config reg. definitions */
-
-#define DCR_WTS 0x01 /* Word transfer select */
-#define DCR_BOS 0x02 /* Byte order select */
-#define DCR_LAS 0x04 /* Long address select */
-#define DCR_LS 0x08 /* Loopback select */
-#define DCR_AR 0x10 /* Auto-init remote */
-#define DCR_FT0 0x20 /* FIFO threshold select */
-#define DCR_FT1 0x40
-
-/* Transmit config reg. definitions */
-
-#define TCR_CRC 0x01 /* Inhibit CRC */
-#define TCR_LB0 0x02 /* Loopback control */
-#define TCR_LB1 0x04
-#define TCR_ATD 0x08 /* Auto transmit disable */
-#define TCR_OFST 0x10 /* Collision offset enable */
-
-/* Transmit status reg. definitions */
-
-#define TSR_PTX 0x01 /* Packet transmitted */
-#define TSR_COL 0x04 /* Transmit collided */
-#define TSR_ABT 0x08 /* Transmit aborted */
-#define TSR_CRS 0x10 /* Carrier sense lost */
-#define TSR_FU 0x20 /* FIFO underrun */
-#define TSR_CDH 0x40 /* CD Heartbeat */
-#define TSR_OWC 0x80 /* Out of Window Collision */
-
-/* Receiver config register definitions */
-
-#define RCR_SEP 0x01 /* Save errored packets */
-#define RCR_AR 0x02 /* Accept runt packets */
-#define RCR_AB 0x04 /* Accept broadcast */
-#define RCR_AM 0x08 /* Accept multicast */
-#define RCR_PRO 0x10 /* Promiscuous mode */
-#define RCR_MON 0x20 /* Monitor mode */
-
-/* Receiver status register definitions */
-
-#define RSR_PRX 0x01 /* Packet received without error */
-#define RSR_CRC 0x02 /* CRC error */
-#define RSR_FAE 0x04 /* Frame alignment error */
-#define RSR_FO 0x08 /* FIFO overrun */
-#define RSR_MPA 0x10 /* Missed packet */
-#define RSR_PHY 0x20 /* Physical address */
-#define RSR_DIS 0x40 /* Received disabled */
-#define RSR_DFR 0x80 /* Deferring (jabber) */
-
-/* Hydra System card address PROM offset */
-
-#define HYDRA_ADDRPROM 0xffc0
-
-
^ permalink raw reply
* [2.6 patch] drivers/net/via-rhine.c: make a function static
From: Adrian Bunk @ 2006-04-04 16:30 UTC (permalink / raw)
To: rl; +Cc: jgarzik, netdev, linux-kernel
This patch makes the needlessly global rhine_set_carrier() static.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
--- linux-2.6.17-rc1-mm1-full/drivers/net/via-rhine.c.old 2006-04-04 17:41:16.000000000 +0200
+++ linux-2.6.17-rc1-mm1-full/drivers/net/via-rhine.c 2006-04-04 17:41:29.000000000 +0200
@@ -1091,7 +1091,7 @@
}
/* Called after status of force_media possibly changed */
-void rhine_set_carrier(struct mii_if_info *mii)
+static void rhine_set_carrier(struct mii_if_info *mii)
{
if (mii->force_media) {
/* autoneg is off: Link is always assumed to be up */
^ permalink raw reply
* [2.6 patch] remove broken and unmaintained Sangoma drivers
From: Adrian Bunk @ 2006-04-04 16:36 UTC (permalink / raw)
To: jgarzik; +Cc: netdev, linux-kernel, David Mandelstam, Nenad Corbic
The in-kernel Sangoma drivers are both not compiling and marked as
BROKEN since at least kernel 2.6.0.
Sangoma offers out-of-tree drivers, and David Mandelstam told me Sangoma
does no longer maintain the in-kernel drivers and prefers to provide
them as a separate installation package.
This patch therefore removes these drivers.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
---
Due to it's size, the patch is available at
ftp://ftp.kernel.org/pub/linux/kernel/people/bunk/misc/patch-remove-sangoma.gz
MAINTAINERS | 7
drivers/net/wan/Kconfig | 97
drivers/net/wan/Makefile | 13
drivers/net/wan/sdla_chdlc.c | 4428 ------------------------
drivers/net/wan/sdla_fr.c | 5061 ---------------------------
drivers/net/wan/sdla_ft1.c | 345 -
drivers/net/wan/sdla_ppp.c | 3430 ------------------
drivers/net/wan/sdla_x25.c | 5497 ------------------------------
drivers/net/wan/sdladrv.c | 2314 ------------
drivers/net/wan/sdlamain.c | 1346 -------
drivers/net/wan/wanpipe_multppp.c | 2358 ------------
include/linux/sdla_asy.h | 226 -
include/linux/sdla_chdlc.h | 813 ----
include/linux/sdla_ppp.h | 575 ---
include/linux/sdla_x25.h | 772 ----
include/linux/sdladrv.h | 66
include/linux/sdlapci.h | 72
include/linux/sdlasfm.h | 104
include/linux/wanpipe.h | 483 --
net/wanrouter/af_wanpipe.c | 2
20 files changed, 28009 deletions(-)
^ permalink raw reply
* [KJ] [Patch] convert drivers/net to kzalloc/kcalloc
From: Eric Sesterhenn @ 2006-04-04 16:39 UTC (permalink / raw)
To: kernel-janitors; +Cc: netdev
[-- Attachment #1: Type: text/plain, Size: 34625 bytes --]
hi,
this patch converts drivers/net to kzalloc and kcalloc usage.
Compile tested with allyesconfig on i386
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
--- linux-2.6.17-rc1/drivers/net/bonding/bond_main.c.orig 2006-04-04 12:12:12.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/bonding/bond_main.c 2006-04-04 12:12:40.000000000 +0200
@@ -1323,14 +1323,12 @@ int bond_enslave(struct net_device *bond
goto err_undo_flags;
}
- new_slave = kmalloc(sizeof(struct slave), GFP_KERNEL);
+ new_slave = kzalloc(sizeof(struct slave), GFP_KERNEL);
if (!new_slave) {
res = -ENOMEM;
goto err_undo_flags;
}
- memset(new_slave, 0, sizeof(struct slave));
-
/* save slave's original flags before calling
* netdev_set_master and dev_open
*/
--- linux-2.6.17-rc1/drivers/net/chelsio/mv88x201x.c.orig 2006-04-04 12:13:03.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/chelsio/mv88x201x.c 2006-04-04 12:13:13.000000000 +0200
@@ -205,11 +205,10 @@ static struct cphy *mv88x201x_phy_create
struct mdio_ops *mdio_ops)
{
u32 val;
- struct cphy *cphy = kmalloc(sizeof(*cphy), GFP_KERNEL);
+ struct cphy *cphy = kzalloc(sizeof(*cphy), GFP_KERNEL);
if (!cphy)
return NULL;
- memset(cphy, 0, sizeof(*cphy));
cphy_init(cphy, adapter, phy_addr, &mv88x201x_ops, mdio_ops);
/* Commands the PHY to enable XFP's clock. */
--- linux-2.6.17-rc1/drivers/net/chelsio/sge.c.orig 2006-04-04 12:13:46.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/chelsio/sge.c 2006-04-04 12:14:43.000000000 +0200
@@ -336,10 +336,9 @@ static int alloc_rx_resources(struct sge
goto err_no_mem;
memset(q->entries, 0, size);
size = sizeof(struct freelQ_ce) * q->size;
- q->centries = kmalloc(size, GFP_KERNEL);
+ q->centries = kzalloc(size, GFP_KERNEL);
if (!q->centries)
goto err_no_mem;
- memset(q->centries, 0, size);
}
/*
@@ -464,10 +463,9 @@ static int alloc_tx_resources(struct sge
goto err_no_mem;
memset(q->entries, 0, size);
size = sizeof(struct cmdQ_ce) * q->size;
- q->centries = kmalloc(size, GFP_KERNEL);
+ q->centries = kzalloc(size, GFP_KERNEL);
if (!q->centries)
goto err_no_mem;
- memset(q->centries, 0, size);
}
/*
@@ -1648,11 +1646,10 @@ static void espibug_workaround(void *dat
struct sge * __devinit t1_sge_create(struct adapter *adapter,
struct sge_params *p)
{
- struct sge *sge = kmalloc(sizeof(*sge), GFP_KERNEL);
+ struct sge *sge = kzalloc(sizeof(*sge), GFP_KERNEL);
if (!sge)
return NULL;
- memset(sge, 0, sizeof(*sge));
sge->adapter = adapter;
sge->netdev = adapter->port[0].dev;
--- linux-2.6.17-rc1/drivers/net/e100.c.orig 2006-04-04 12:14:56.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/e100.c 2006-04-04 12:16:11.000000000 +0200
@@ -1931,9 +1931,8 @@ static int e100_rx_alloc_list(struct nic
nic->rx_to_use = nic->rx_to_clean = NULL;
nic->ru_running = RU_UNINITIALIZED;
- if(!(nic->rxs = kmalloc(sizeof(struct rx) * count, GFP_ATOMIC)))
+ if(!(nic->rxs = kcalloc(count, sizeof(struct rx), GFP_ATOMIC)))
return -ENOMEM;
- memset(nic->rxs, 0, sizeof(struct rx) * count);
for(rx = nic->rxs, i = 0; i < count; rx++, i++) {
rx->next = (i + 1 < count) ? rx + 1 : nic->rxs;
--- linux-2.6.17-rc1/drivers/net/e1000/e1000_ethtool.c.orig 2006-04-04 12:16:24.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/e1000/e1000_ethtool.c 2006-04-04 12:18:47.000000000 +0200
@@ -636,20 +636,18 @@ e1000_set_ringparam(struct net_device *n
tx_old = adapter->tx_ring;
rx_old = adapter->rx_ring;
- adapter->tx_ring = kmalloc(tx_ring_size, GFP_KERNEL);
+ adapter->tx_ring = kzalloc(tx_ring_size, GFP_KERNEL);
if (!adapter->tx_ring) {
err = -ENOMEM;
goto err_setup_rx;
}
- memset(adapter->tx_ring, 0, tx_ring_size);
- adapter->rx_ring = kmalloc(rx_ring_size, GFP_KERNEL);
+ adapter->rx_ring = kzalloc(rx_ring_size, GFP_KERNEL);
if (!adapter->rx_ring) {
kfree(adapter->tx_ring);
err = -ENOMEM;
goto err_setup_rx;
}
- memset(adapter->rx_ring, 0, rx_ring_size);
txdr = adapter->tx_ring;
rxdr = adapter->rx_ring;
@@ -1013,11 +1011,10 @@ e1000_setup_desc_rings(struct e1000_adap
txdr->count = E1000_DEFAULT_TXD;
size = txdr->count * sizeof(struct e1000_buffer);
- if (!(txdr->buffer_info = kmalloc(size, GFP_KERNEL))) {
+ if (!(txdr->buffer_info = kzalloc(size, GFP_KERNEL))) {
ret_val = 1;
goto err_nomem;
}
- memset(txdr->buffer_info, 0, size);
txdr->size = txdr->count * sizeof(struct e1000_tx_desc);
E1000_ROUNDUP(txdr->size, 4096);
@@ -1069,11 +1066,10 @@ e1000_setup_desc_rings(struct e1000_adap
rxdr->count = E1000_DEFAULT_RXD;
size = rxdr->count * sizeof(struct e1000_buffer);
- if (!(rxdr->buffer_info = kmalloc(size, GFP_KERNEL))) {
+ if (!(rxdr->buffer_info = kzalloc(size, GFP_KERNEL))) {
ret_val = 4;
goto err_nomem;
}
- memset(rxdr->buffer_info, 0, size);
rxdr->size = rxdr->count * sizeof(struct e1000_rx_desc);
if (!(rxdr->desc = pci_alloc_consistent(pdev, rxdr->size, &rxdr->dma))) {
--- linux-2.6.17-rc1/drivers/net/e1000/e1000_main.c.orig 2006-04-04 12:18:56.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/e1000/e1000_main.c 2006-04-04 12:47:47.000000000 +0200
@@ -1055,28 +1055,25 @@ e1000_alloc_queues(struct e1000_adapter
int size;
size = sizeof(struct e1000_tx_ring) * adapter->num_tx_queues;
- adapter->tx_ring = kmalloc(size, GFP_KERNEL);
+ adapter->tx_ring = kzalloc(size, GFP_KERNEL);
if (!adapter->tx_ring)
return -ENOMEM;
- memset(adapter->tx_ring, 0, size);
size = sizeof(struct e1000_rx_ring) * adapter->num_rx_queues;
- adapter->rx_ring = kmalloc(size, GFP_KERNEL);
+ adapter->rx_ring = kzalloc(size, GFP_KERNEL);
if (!adapter->rx_ring) {
kfree(adapter->tx_ring);
return -ENOMEM;
}
- memset(adapter->rx_ring, 0, size);
#ifdef CONFIG_E1000_NAPI
size = sizeof(struct net_device) * adapter->num_rx_queues;
- adapter->polling_netdev = kmalloc(size, GFP_KERNEL);
+ adapter->polling_netdev = kzalloc(size, GFP_KERNEL);
if (!adapter->polling_netdev) {
kfree(adapter->tx_ring);
kfree(adapter->rx_ring);
return -ENOMEM;
}
- memset(adapter->polling_netdev, 0, size);
#endif
return E1000_SUCCESS;
@@ -1450,17 +1447,16 @@ e1000_setup_rx_resources(struct e1000_ad
memset(rxdr->buffer_info, 0, size);
size = sizeof(struct e1000_ps_page) * rxdr->count;
- rxdr->ps_page = kmalloc(size, GFP_KERNEL);
+ rxdr->ps_page = kzalloc(size, GFP_KERNEL);
if (!rxdr->ps_page) {
vfree(rxdr->buffer_info);
DPRINTK(PROBE, ERR,
"Unable to allocate memory for the receive descriptor ring\n");
return -ENOMEM;
}
- memset(rxdr->ps_page, 0, size);
size = sizeof(struct e1000_ps_page_dma) * rxdr->count;
- rxdr->ps_page_dma = kmalloc(size, GFP_KERNEL);
+ rxdr->ps_page_dma = kzalloc(size, GFP_KERNEL);
if (!rxdr->ps_page_dma) {
vfree(rxdr->buffer_info);
kfree(rxdr->ps_page);
@@ -1468,7 +1464,6 @@ e1000_setup_rx_resources(struct e1000_ad
"Unable to allocate memory for the receive descriptor ring\n");
return -ENOMEM;
}
- memset(rxdr->ps_page_dma, 0, size);
if (adapter->hw.mac_type <= e1000_82547_rev_2)
desc_len = sizeof(struct e1000_rx_desc);
--- linux-2.6.17-rc1/drivers/net/fs_enet/fs_enet-mii.c.orig 2006-04-04 12:20:25.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/fs_enet/fs_enet-mii.c 2006-04-04 12:20:36.000000000 +0200
@@ -389,12 +389,11 @@ static struct fs_enet_mii_bus *create_bu
struct fs_enet_mii_bus *bus;
int ret = 0;
- bus = kmalloc(sizeof(*bus), GFP_KERNEL);
+ bus = kzalloc(sizeof(*bus), GFP_KERNEL);
if (bus == NULL) {
ret = -ENOMEM;
goto err;
}
- memset(bus, 0, sizeof(*bus));
spin_lock_init(&bus->mii_lock);
bus->bus_info = bi;
bus->refs = 0;
--- linux-2.6.17-rc1/drivers/net/irda/irda-usb.c.orig 2006-04-04 12:20:47.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/irda/irda-usb.c 2006-04-04 12:21:17.000000000 +0200
@@ -1344,10 +1344,9 @@ static inline struct irda_class_desc *ir
struct irda_class_desc *desc;
int ret;
- desc = kmalloc(sizeof (*desc), GFP_KERNEL);
+ desc = kzalloc(sizeof (*desc), GFP_KERNEL);
if (desc == NULL)
return NULL;
- memset(desc, 0, sizeof(*desc));
/* USB-IrDA class spec 1.0:
* 6.1.3: Standard "Get Descriptor" Device Request is not
@@ -1496,12 +1495,10 @@ static int irda_usb_probe(struct usb_int
/* Don't change this buffer size and allocation without doing
* some heavy and complete testing. Don't ask why :-(
* Jean II */
- self->speed_buff = (char *) kmalloc(IRDA_USB_SPEED_MTU, GFP_KERNEL);
+ self->speed_buff = kzalloc(IRDA_USB_SPEED_MTU, GFP_KERNEL);
if (self->speed_buff == NULL)
goto err_out_3;
- memset(self->speed_buff, 0, IRDA_USB_SPEED_MTU);
-
ret = irda_usb_open(self);
if (ret)
goto err_out_4;
--- linux-2.6.17-rc1/drivers/net/irda/irtty-sir.c.orig 2006-04-04 12:21:43.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/irda/irtty-sir.c 2006-04-04 12:22:01.000000000 +0200
@@ -505,10 +505,9 @@ static int irtty_open(struct tty_struct
}
/* allocate private device info block */
- priv = kmalloc(sizeof(*priv), GFP_KERNEL);
+ priv = kzalloc(sizeof(*priv), GFP_KERNEL);
if (!priv)
goto out_put;
- memset(priv, 0, sizeof(*priv));
priv->magic = IRTTY_MAGIC;
priv->tty = tty;
--- linux-2.6.17-rc1/drivers/net/irda/vlsi_ir.c.orig 2006-04-04 12:22:11.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/irda/vlsi_ir.c 2006-04-04 12:22:53.000000000 +0200
@@ -413,10 +413,9 @@ static struct vlsi_ring *vlsi_alloc_ring
if (!size || ((size-1)&size)!=0) /* must be >0 and power of 2 */
return NULL;
- r = kmalloc(sizeof(*r) + size * sizeof(struct ring_descr), GFP_KERNEL);
+ r = kzalloc(sizeof(*r) + size * sizeof(struct ring_descr), GFP_KERNEL);
if (!r)
return NULL;
- memset(r, 0, sizeof(*r));
r->pdev = pdev;
r->dir = dir;
@@ -429,7 +428,6 @@ static struct vlsi_ring *vlsi_alloc_ring
for (i = 0; i < size; i++) {
rd = r->rd + i;
- memset(rd, 0, sizeof(*rd));
rd->hw = hwmap + i;
rd->buf = kmalloc(len, GFP_KERNEL|GFP_DMA);
if (rd->buf == NULL
--- linux-2.6.17-rc1/drivers/net/iseries_veth.c.orig 2006-04-04 12:23:08.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/iseries_veth.c 2006-04-04 12:23:49.000000000 +0200
@@ -820,10 +820,9 @@ static int veth_init_connection(u8 rlp)
|| ! HvLpConfig_doLpsCommunicateOnVirtualLan(this_lp, rlp) )
return 0;
- cnx = kmalloc(sizeof(*cnx), GFP_KERNEL);
+ cnx = kzalloc(sizeof(*cnx), GFP_KERNEL);
if (! cnx)
return -ENOMEM;
- memset(cnx, 0, sizeof(*cnx));
cnx->remote_lp = rlp;
spin_lock_init(&cnx->lock);
@@ -850,14 +849,13 @@ static int veth_init_connection(u8 rlp)
if (rc != 0)
return rc;
- msgs = kmalloc(VETH_NUMBUFFERS * sizeof(struct veth_msg), GFP_KERNEL);
+ msgs = kzalloc(VETH_NUMBUFFERS * sizeof(struct veth_msg), GFP_KERNEL);
if (! msgs) {
veth_error("Can't allocate buffers for LPAR %d.\n", rlp);
return -ENOMEM;
}
cnx->msgs = msgs;
- memset(msgs, 0, VETH_NUMBUFFERS * sizeof(struct veth_msg));
for (i = 0; i < VETH_NUMBUFFERS; i++) {
msgs[i].token = i;
--- linux-2.6.17-rc1/drivers/net/lance.c.orig 2006-04-04 12:23:57.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/lance.c 2006-04-04 12:24:19.000000000 +0200
@@ -532,11 +532,10 @@ static int __init lance_probe1(struct ne
dev->base_addr = ioaddr;
/* Make certain the data structures used by the LANCE are aligned and DMAble. */
- lp = kmalloc(sizeof(*lp), GFP_DMA | GFP_KERNEL);
+ lp = kzalloc(sizeof(*lp), GFP_DMA | GFP_KERNEL);
if(lp==NULL)
return -ENODEV;
if (lance_debug > 6) printk(" (#0x%05lx)", (unsigned long)lp);
- memset(lp, 0, sizeof(*lp));
dev->priv = lp;
lp->name = chipname;
lp->rx_buffs = (unsigned long)kmalloc(PKT_BUF_SZ*RX_RING_SIZE,
--- linux-2.6.17-rc1/drivers/net/loopback.c.orig 2006-04-04 12:24:31.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/loopback.c 2006-04-04 12:24:49.000000000 +0200
@@ -224,9 +224,8 @@ int __init loopback_init(void)
struct net_device_stats *stats;
/* Can survive without statistics */
- stats = kmalloc(sizeof(struct net_device_stats), GFP_KERNEL);
+ stats = kzalloc(sizeof(struct net_device_stats), GFP_KERNEL);
if (stats) {
- memset(stats, 0, sizeof(struct net_device_stats));
loopback_dev.priv = stats;
loopback_dev.get_stats = &get_stats;
}
--- linux-2.6.17-rc1/drivers/net/mipsnet.c.orig 2006-04-04 12:24:58.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/mipsnet.c 2006-04-04 12:25:08.000000000 +0200
@@ -323,12 +323,11 @@ static int __init mipsnet_init_module(vo
goto out;
}
- if (!(pldev = kmalloc (sizeof (*pldev), GFP_KERNEL))) {
+ if (!(pldev = kzalloc (sizeof (*pldev), GFP_KERNEL))) {
err = -ENOMEM;
goto out_unregister_driver;
}
- memset (pldev, 0, sizeof (*pldev));
pldev->name = mipsnet_string;
pldev->id = 0;
pldev->dev.release = mipsnet_platform_release;
--- linux-2.6.17-rc1/drivers/net/pcmcia/ibmtr_cs.c.orig 2006-04-04 12:25:34.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/pcmcia/ibmtr_cs.c 2006-04-04 12:25:43.000000000 +0200
@@ -146,9 +146,8 @@ static int ibmtr_attach(struct pcmcia_de
DEBUG(0, "ibmtr_attach()\n");
/* Create new token-ring device */
- info = kmalloc(sizeof(*info), GFP_KERNEL);
+ info = kzalloc(sizeof(*info), GFP_KERNEL);
if (!info) return -ENOMEM;
- memset(info,0,sizeof(*info));
dev = alloc_trdev(sizeof(struct tok_info));
if (!dev) {
kfree(info);
--- linux-2.6.17-rc1/drivers/net/ppp_async.c.orig 2006-04-04 12:25:57.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/ppp_async.c 2006-04-04 12:26:06.000000000 +0200
@@ -159,12 +159,11 @@ ppp_asynctty_open(struct tty_struct *tty
int err;
err = -ENOMEM;
- ap = kmalloc(sizeof(*ap), GFP_KERNEL);
+ ap = kzalloc(sizeof(*ap), GFP_KERNEL);
if (ap == 0)
goto out;
/* initialize the asyncppp structure */
- memset(ap, 0, sizeof(*ap));
ap->tty = tty;
ap->mru = PPP_MRU;
spin_lock_init(&ap->xmit_lock);
--- linux-2.6.17-rc1/drivers/net/ppp_deflate.c.orig 2006-04-04 12:26:14.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/ppp_deflate.c 2006-04-04 12:26:50.000000000 +0200
@@ -121,12 +121,10 @@ static void *z_comp_alloc(unsigned char
if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE)
return NULL;
- state = (struct ppp_deflate_state *) kmalloc(sizeof(*state),
- GFP_KERNEL);
+ state = kzalloc(sizeof(*state), GFP_KERNEL);
if (state == NULL)
return NULL;
- memset (state, 0, sizeof (struct ppp_deflate_state));
state->strm.next_in = NULL;
state->w_size = w_size;
state->strm.workspace = vmalloc(zlib_deflate_workspacesize());
@@ -341,11 +339,10 @@ static void *z_decomp_alloc(unsigned cha
if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE)
return NULL;
- state = (struct ppp_deflate_state *) kmalloc(sizeof(*state), GFP_KERNEL);
+ state = kzalloc(sizeof(*state), GFP_KERNEL);
if (state == NULL)
return NULL;
- memset (state, 0, sizeof (struct ppp_deflate_state));
state->w_size = w_size;
state->strm.next_out = NULL;
state->strm.workspace = kmalloc(zlib_inflate_workspacesize(),
--- linux-2.6.17-rc1/drivers/net/ppp_generic.c.orig 2006-04-04 12:26:58.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/ppp_generic.c 2006-04-04 12:27:59.000000000 +0200
@@ -2006,10 +2006,9 @@ ppp_register_channel(struct ppp_channel
{
struct channel *pch;
- pch = kmalloc(sizeof(struct channel), GFP_KERNEL);
+ pch = kzalloc(sizeof(struct channel), GFP_KERNEL);
if (pch == 0)
return -ENOMEM;
- memset(pch, 0, sizeof(struct channel));
pch->ppp = NULL;
pch->chan = chan;
chan->ppp = pch;
@@ -2419,13 +2418,12 @@ ppp_create_interface(int unit, int *retp
int ret = -ENOMEM;
int i;
- ppp = kmalloc(sizeof(struct ppp), GFP_KERNEL);
+ ppp = kzalloc(sizeof(struct ppp), GFP_KERNEL);
if (!ppp)
goto out;
dev = alloc_netdev(0, "", ppp_setup);
if (!dev)
goto out1;
- memset(ppp, 0, sizeof(struct ppp));
ppp->mru = PPP_MRU;
init_ppp_file(&ppp->file, INTERFACE);
@@ -2717,8 +2715,7 @@ static void cardmap_set(struct cardmap *
if (p == NULL || (nr >> p->shift) >= CARDMAP_WIDTH) {
do {
/* need a new top level */
- struct cardmap *np = kmalloc(sizeof(*np), GFP_KERNEL);
- memset(np, 0, sizeof(*np));
+ struct cardmap *np = kzalloc(sizeof(*np), GFP_KERNEL);
np->ptr[0] = p;
if (p != NULL) {
np->shift = p->shift + CARDMAP_ORDER;
@@ -2732,8 +2729,7 @@ static void cardmap_set(struct cardmap *
while (p->shift > 0) {
i = (nr >> p->shift) & CARDMAP_MASK;
if (p->ptr[i] == NULL) {
- struct cardmap *np = kmalloc(sizeof(*np), GFP_KERNEL);
- memset(np, 0, sizeof(*np));
+ struct cardmap *np = kzalloc(sizeof(*np), GFP_KERNEL);
np->shift = p->shift - CARDMAP_ORDER;
np->parent = p;
p->ptr[i] = np;
--- linux-2.6.17-rc1/drivers/net/ppp_mppe.c.orig 2006-04-04 12:28:10.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/ppp_mppe.c 2006-04-04 12:28:24.000000000 +0200
@@ -191,12 +191,10 @@ static void *mppe_alloc(unsigned char *o
|| options[0] != CI_MPPE || options[1] != CILEN_MPPE)
goto out;
- state = (struct ppp_mppe_state *) kmalloc(sizeof(*state), GFP_KERNEL);
+ state = kzalloc(sizeof(*state), GFP_KERNEL);
if (state == NULL)
goto out;
- memset(state, 0, sizeof(*state));
-
state->arc4 = crypto_alloc_tfm("arc4", 0);
if (!state->arc4)
goto out_free;
--- linux-2.6.17-rc1/drivers/net/ppp_synctty.c.orig 2006-04-04 12:28:31.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/ppp_synctty.c 2006-04-04 12:28:47.000000000 +0200
@@ -207,13 +207,12 @@ ppp_sync_open(struct tty_struct *tty)
struct syncppp *ap;
int err;
- ap = kmalloc(sizeof(*ap), GFP_KERNEL);
+ ap = kzalloc(sizeof(*ap), GFP_KERNEL);
err = -ENOMEM;
if (ap == 0)
goto out;
/* initialize the syncppp structure */
- memset(ap, 0, sizeof(*ap));
ap->tty = tty;
ap->mru = PPP_MRU;
spin_lock_init(&ap->xmit_lock);
--- linux-2.6.17-rc1/drivers/net/s2io.c.orig 2006-04-04 12:28:55.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/s2io.c 2006-04-04 12:29:56.000000000 +0200
@@ -407,14 +407,13 @@ static int init_shared_mem(struct s2io_n
for (i = 0; i < config->tx_fifo_num; i++) {
int fifo_len = config->tx_cfg[i].fifo_len;
int list_holder_size = fifo_len * sizeof(list_info_hold_t);
- mac_control->fifos[i].list_info = kmalloc(list_holder_size,
+ mac_control->fifos[i].list_info = kzalloc(list_holder_size,
GFP_KERNEL);
if (!mac_control->fifos[i].list_info) {
DBG_PRINT(ERR_DBG,
"Malloc failed for list_info\n");
return -ENOMEM;
}
- memset(mac_control->fifos[i].list_info, 0, list_holder_size);
}
for (i = 0; i < config->tx_fifo_num; i++) {
int page_num = TXD_MEM_PAGE_CNT(config->tx_cfg[i].fifo_len,
@@ -3229,24 +3228,21 @@ static int s2io_enable_msi_x(nic_t *nic)
u16 msi_control; /* Temp variable */
int ret, i, j, msix_indx = 1;
- nic->entries = kmalloc(MAX_REQUESTED_MSI_X * sizeof(struct msix_entry),
+ nic->entries = kzalloc(MAX_REQUESTED_MSI_X * sizeof(struct msix_entry),
GFP_KERNEL);
if (nic->entries == NULL) {
DBG_PRINT(ERR_DBG, "%s: Memory allocation failed\n", __FUNCTION__);
return -ENOMEM;
}
- memset(nic->entries, 0, MAX_REQUESTED_MSI_X * sizeof(struct msix_entry));
nic->s2io_entries =
- kmalloc(MAX_REQUESTED_MSI_X * sizeof(struct s2io_msix_entry),
+ kzalloc(MAX_REQUESTED_MSI_X * sizeof(struct s2io_msix_entry),
GFP_KERNEL);
if (nic->s2io_entries == NULL) {
DBG_PRINT(ERR_DBG, "%s: Memory allocation failed\n", __FUNCTION__);
kfree(nic->entries);
return -ENOMEM;
}
- memset(nic->s2io_entries, 0,
- MAX_REQUESTED_MSI_X * sizeof(struct s2io_msix_entry));
for (i=0; i< MAX_REQUESTED_MSI_X; i++) {
nic->entries[i].entry = i;
--- linux-2.6.17-rc1/drivers/net/sb1250-mac.c.orig 2006-04-04 12:30:04.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/sb1250-mac.c 2006-04-04 12:30:51.000000000 +0200
@@ -757,9 +757,8 @@ static void sbdma_initctx(sbmacdma_t *d,
*/
d->sbdma_ctxtable = (struct sk_buff **)
- kmalloc(d->sbdma_maxdescr*sizeof(struct sk_buff *), GFP_KERNEL);
-
- memset(d->sbdma_ctxtable,0,d->sbdma_maxdescr*sizeof(struct sk_buff *));
+ kcalloc(d->sbdma_maxdescr, sizeof(struct sk_buff *),
+ GFP_KERNEL);
#ifdef CONFIG_SBMAC_COALESCE
/*
--- linux-2.6.17-rc1/drivers/net/shaper.c.orig 2006-04-04 12:31:00.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/shaper.c 2006-04-04 12:31:10.000000000 +0200
@@ -601,10 +601,9 @@ static int __init shaper_init(void)
return -ENODEV;
alloc_size = sizeof(*dev) * shapers;
- devs = kmalloc(alloc_size, GFP_KERNEL);
+ devs = kzalloc(alloc_size, GFP_KERNEL);
if (!devs)
return -ENOMEM;
- memset(devs, 0, alloc_size);
for (i = 0; i < shapers; i++) {
--- linux-2.6.17-rc1/drivers/net/slhc.c.orig 2006-04-04 12:31:21.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/slhc.c 2006-04-04 12:31:56.000000000 +0200
@@ -95,27 +95,23 @@ slhc_init(int rslots, int tslots)
register struct cstate *ts;
struct slcompress *comp;
- comp = (struct slcompress *)kmalloc(sizeof(struct slcompress),
- GFP_KERNEL);
+ comp = kzalloc(sizeof(struct slcompress), GFP_KERNEL);
if (! comp)
goto out_fail;
- memset(comp, 0, sizeof(struct slcompress));
if ( rslots > 0 && rslots < 256 ) {
size_t rsize = rslots * sizeof(struct cstate);
- comp->rstate = (struct cstate *) kmalloc(rsize, GFP_KERNEL);
+ comp->rstate = kzalloc(rsize, GFP_KERNEL);
if (! comp->rstate)
goto out_free;
- memset(comp->rstate, 0, rsize);
comp->rslot_limit = rslots - 1;
}
if ( tslots > 0 && tslots < 256 ) {
size_t tsize = tslots * sizeof(struct cstate);
- comp->tstate = (struct cstate *) kmalloc(tsize, GFP_KERNEL);
+ comp->tstate = kzalloc(tsize, GFP_KERNEL);
if (! comp->tstate)
goto out_free2;
- memset(comp->tstate, 0, tsize);
comp->tslot_limit = tslots - 1;
}
--- linux-2.6.17-rc1/drivers/net/via-velocity.c.orig 2006-04-04 12:32:12.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/via-velocity.c 2006-04-04 12:32:45.000000000 +0200
@@ -1072,10 +1072,9 @@ static int velocity_init_rd_ring(struct
unsigned int rsize = sizeof(struct velocity_rd_info) *
vptr->options.numrx;
- vptr->rd_info = kmalloc(rsize, GFP_KERNEL);
+ vptr->rd_info = kzalloc(rsize, GFP_KERNEL);
if(vptr->rd_info == NULL)
goto out;
- memset(vptr->rd_info, 0, rsize);
vptr->rd_filled = vptr->rd_dirty = vptr->rd_curr = 0;
@@ -1146,14 +1145,13 @@ static int velocity_init_td_ring(struct
for (j = 0; j < vptr->num_txq; j++) {
curr = vptr->td_pool_dma[j];
- vptr->td_infos[j] = kmalloc(tsize, GFP_KERNEL);
+ vptr->td_infos[j] = kzalloc(tsize, GFP_KERNEL);
if(vptr->td_infos[j] == NULL)
{
while(--j >= 0)
kfree(vptr->td_infos[j]);
return -ENOMEM;
}
- memset(vptr->td_infos[j], 0, tsize);
for (i = 0; i < vptr->options.numtx; i++, curr += sizeof(struct tx_desc)) {
td = &(vptr->td_rings[j][i]);
--- linux-2.6.17-rc1/drivers/net/wan/c101.c.orig 2006-04-04 12:32:57.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/wan/c101.c 2006-04-04 12:33:08.000000000 +0200
@@ -309,12 +309,11 @@ static int __init c101_run(unsigned long
return -ENODEV;
}
- card = kmalloc(sizeof(card_t), GFP_KERNEL);
+ card = kzalloc(sizeof(card_t), GFP_KERNEL);
if (card == NULL) {
printk(KERN_ERR "c101: unable to allocate memory\n");
return -ENOBUFS;
}
- memset(card, 0, sizeof(card_t));
card->dev = alloc_hdlcdev(card);
if (!card->dev) {
--- linux-2.6.17-rc1/drivers/net/wan/cosa.c.orig 2006-04-04 12:33:19.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/wan/cosa.c 2006-04-04 12:33:47.000000000 +0200
@@ -587,13 +587,12 @@ static int cosa_probe(int base, int irq,
sprintf(cosa->name, "cosa%d", cosa->num);
/* Initialize the per-channel data */
- cosa->chan = kmalloc(sizeof(struct channel_data)*cosa->nchannels,
+ cosa->chan = kcalloc(cosa->nchannels, sizeof(struct channel_data),
GFP_KERNEL);
if (!cosa->chan) {
err = -ENOMEM;
goto err_out3;
}
- memset(cosa->chan, 0, sizeof(struct channel_data)*cosa->nchannels);
for (i=0; i<cosa->nchannels; i++) {
cosa->chan[i].cosa = cosa;
cosa->chan[i].num = i;
--- linux-2.6.17-rc1/drivers/net/wan/cycx_main.c.orig 2006-04-04 12:33:56.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/wan/cycx_main.c 2006-04-04 12:34:20.000000000 +0200
@@ -114,13 +114,11 @@ static int __init cycx_init(void)
/* Verify number of cards and allocate adapter data space */
cycx_ncards = min_t(int, cycx_ncards, CYCX_MAX_CARDS);
cycx_ncards = max_t(int, cycx_ncards, 1);
- cycx_card_array = kmalloc(sizeof(struct cycx_device) * cycx_ncards,
+ cycx_card_array = kcalloc(cycx_ncards, sizeof(struct cycx_device),
GFP_KERNEL);
if (!cycx_card_array)
goto out;
- memset(cycx_card_array, 0, sizeof(struct cycx_device) * cycx_ncards);
-
/* Register adapters with WAN router */
for (cnt = 0; cnt < cycx_ncards; ++cnt) {
struct cycx_device *card = &cycx_card_array[cnt];
--- linux-2.6.17-rc1/drivers/net/wan/cycx_x25.c.orig 2006-04-04 12:34:28.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/wan/cycx_x25.c 2006-04-04 12:34:51.000000000 +0200
@@ -376,11 +376,10 @@ static int cycx_wan_new_if(struct wan_de
}
/* allocate and initialize private data */
- chan = kmalloc(sizeof(struct cycx_x25_channel), GFP_KERNEL);
+ chan = kzalloc(sizeof(struct cycx_x25_channel), GFP_KERNEL);
if (!chan)
return -ENOMEM;
- memset(chan, 0, sizeof(*chan));
strcpy(chan->name, conf->name);
chan->card = card;
chan->link = conf->port;
--- linux-2.6.17-rc1/drivers/net/wan/dscc4.c.orig 2006-04-04 12:35:00.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/wan/dscc4.c 2006-04-04 12:35:34.000000000 +0200
@@ -890,12 +890,11 @@ static int dscc4_found1(struct pci_dev *
struct dscc4_dev_priv *root;
int i, ret = -ENOMEM;
- root = kmalloc(dev_per_card*sizeof(*root), GFP_KERNEL);
+ root = kcalloc(dev_per_card, sizeof(*root), GFP_KERNEL);
if (!root) {
printk(KERN_ERR "%s: can't allocate data\n", DRV_NAME);
goto err_out;
}
- memset(root, 0, dev_per_card*sizeof(*root));
for (i = 0; i < dev_per_card; i++) {
root[i].dev = alloc_hdlcdev(root + i);
@@ -903,12 +902,11 @@ static int dscc4_found1(struct pci_dev *
goto err_free_dev;
}
- ppriv = kmalloc(sizeof(*ppriv), GFP_KERNEL);
+ ppriv = kzalloc(sizeof(*ppriv), GFP_KERNEL);
if (!ppriv) {
printk(KERN_ERR "%s: can't allocate private data\n", DRV_NAME);
goto err_free_dev;
}
- memset(ppriv, 0, sizeof(struct dscc4_pci_priv));
ppriv->root = root;
spin_lock_init(&ppriv->lock);
--- linux-2.6.17-rc1/drivers/net/wan/farsync.c.orig 2006-04-04 12:35:43.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/wan/farsync.c 2006-04-04 12:35:54.000000000 +0200
@@ -2476,13 +2476,12 @@ fst_add_one(struct pci_dev *pdev, const
}
/* Allocate driver private data */
- card = kmalloc(sizeof (struct fst_card_info), GFP_KERNEL);
+ card = kzalloc(sizeof (struct fst_card_info), GFP_KERNEL);
if (card == NULL) {
printk_err("FarSync card found but insufficient memory for"
" driver storage\n");
return -ENOMEM;
}
- memset(card, 0, sizeof (struct fst_card_info));
/* Try to enable the device */
if ((err = pci_enable_device(pdev)) != 0) {
--- linux-2.6.17-rc1/drivers/net/wan/hdlc_fr.c.orig 2006-04-04 12:36:06.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/wan/hdlc_fr.c 2006-04-04 12:36:21.000000000 +0200
@@ -159,11 +159,10 @@ static inline pvc_device* add_pvc(struct
pvc_p = &(*pvc_p)->next;
}
- pvc = kmalloc(sizeof(pvc_device), GFP_ATOMIC);
+ pvc = kzalloc(sizeof(pvc_device), GFP_ATOMIC);
if (!pvc)
return NULL;
- memset(pvc, 0, sizeof(pvc_device));
pvc->dlci = dlci;
pvc->master = dev;
pvc->next = *pvc_p; /* Put it in the chain */
--- linux-2.6.17-rc1/drivers/net/wan/hostess_sv11.c.orig 2006-04-04 12:36:28.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/wan/hostess_sv11.c 2006-04-04 12:36:46.000000000 +0200
@@ -231,11 +231,10 @@ static struct sv11_device *sv11_init(int
return NULL;
}
- sv=(struct sv11_device *)kmalloc(sizeof(struct sv11_device), GFP_KERNEL);
+ sv = kzalloc(sizeof(struct sv11_device), GFP_KERNEL);
if(!sv)
goto fail3;
- memset(sv, 0, sizeof(*sv));
sv->if_ptr=&sv->netdev;
sv->netdev.dev = alloc_netdev(0, "hdlc%d", sv11_setup);
--- linux-2.6.17-rc1/drivers/net/wan/n2.c.orig 2006-04-04 12:36:55.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/wan/n2.c 2006-04-04 12:37:02.000000000 +0200
@@ -351,12 +351,11 @@ static int __init n2_run(unsigned long i
return -ENODEV;
}
- card = kmalloc(sizeof(card_t), GFP_KERNEL);
+ card = kzalloc(sizeof(card_t), GFP_KERNEL);
if (card == NULL) {
printk(KERN_ERR "n2: unable to allocate memory\n");
return -ENOBUFS;
}
- memset(card, 0, sizeof(card_t));
card->ports[0].dev = alloc_hdlcdev(&card->ports[0]);
card->ports[1].dev = alloc_hdlcdev(&card->ports[1]);
--- linux-2.6.17-rc1/drivers/net/wan/sdla.c.orig 2006-04-04 12:37:10.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/wan/sdla.c 2006-04-04 12:37:30.000000000 +0200
@@ -1203,10 +1203,9 @@ static int sdla_xfer(struct net_device *
if (read)
{
- temp = kmalloc(mem.len, GFP_KERNEL);
+ temp = kzalloc(mem.len, GFP_KERNEL);
if (!temp)
return(-ENOMEM);
- memset(temp, 0, mem.len);
sdla_read(dev, mem.addr, temp, mem.len);
if(copy_to_user(mem.data, temp, mem.len))
{
--- linux-2.6.17-rc1/drivers/net/wan/sdla_chdlc.c.orig 2006-04-04 12:37:38.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/wan/sdla_chdlc.c 2006-04-04 12:37:56.000000000 +0200
@@ -679,13 +679,11 @@ static int new_if(struct wan_device* wan
}
/* allocate and initialize private data */
- chdlc_priv_area = kmalloc(sizeof(chdlc_private_area_t), GFP_KERNEL);
+ chdlc_priv_area = kzalloc(sizeof(chdlc_private_area_t), GFP_KERNEL);
if(chdlc_priv_area == NULL)
return -ENOMEM;
- memset(chdlc_priv_area, 0, sizeof(chdlc_private_area_t));
-
chdlc_priv_area->card = card;
chdlc_priv_area->common.sk = NULL;
chdlc_priv_area->common.func = NULL;
--- linux-2.6.17-rc1/drivers/net/wan/sdla_fr.c.orig 2006-04-04 12:38:09.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/wan/sdla_fr.c 2006-04-04 12:38:42.000000000 +0200
@@ -812,12 +812,11 @@ static int new_if(struct wan_device* wan
}
/* allocate and initialize private data */
- chan = kmalloc(sizeof(fr_channel_t), GFP_KERNEL);
+ chan = kzalloc(sizeof(fr_channel_t), GFP_KERNEL);
if (chan == NULL)
return -ENOMEM;
- memset(chan, 0, sizeof(fr_channel_t));
strcpy(chan->name, conf->name);
chan->card = card;
@@ -1214,8 +1213,7 @@ static int if_open(struct net_device* de
INIT_WORK(&chan->common.wanpipe_work, (void *)fr_bh, dev);
/* Allocate and initialize BH circular buffer */
- chan->bh_head = kmalloc((sizeof(bh_data_t)*MAX_BH_BUFF),GFP_ATOMIC);
- memset(chan->bh_head,0,(sizeof(bh_data_t)*MAX_BH_BUFF));
+ chan->bh_head = kzalloc((sizeof(bh_data_t)*MAX_BH_BUFF),GFP_ATOMIC);
atomic_set(&chan->bh_buff_used, 0);
netif_start_queue(dev);
--- linux-2.6.17-rc1/drivers/net/wan/sdla_ppp.c.orig 2006-04-04 12:38:49.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/wan/sdla_ppp.c 2006-04-04 12:39:19.000000000 +0200
@@ -528,13 +528,11 @@ static int new_if(struct wan_device *wan
}
/* allocate and initialize private data */
- ppp_priv_area = kmalloc(sizeof(ppp_private_area_t), GFP_KERNEL);
+ ppp_priv_area = kzalloc(sizeof(ppp_private_area_t), GFP_KERNEL);
if( ppp_priv_area == NULL )
return -ENOMEM;
- memset(ppp_priv_area, 0, sizeof(ppp_private_area_t));
-
ppp_priv_area->card = card;
/* initialize data */
--- linux-2.6.17-rc1/drivers/net/wan/sdla_x25.c.orig 2006-04-04 12:39:26.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/wan/sdla_x25.c 2006-04-04 12:40:11.000000000 +0200
@@ -926,13 +926,11 @@ static int new_if(struct wan_device* wan
}
/* allocate and initialize private data */
- chan = kmalloc(sizeof(x25_channel_t), GFP_ATOMIC);
+ chan = kzalloc(sizeof(x25_channel_t), GFP_ATOMIC);
if (chan == NULL){
return -ENOMEM;
}
- memset(chan, 0, sizeof(x25_channel_t));
-
/* Bug Fix: Seg Err on PVC startup
* It must be here since bind_lcn_to_dev expects
* it bellow */
@@ -1194,7 +1192,7 @@ static int if_open(struct net_device* de
/* Allocate and initialize BH circular buffer */
/* Add 1 to MAX_BH_BUFF so we don't have test with (MAX_BH_BUFF-1) */
- chan->bh_head = kmalloc((sizeof(bh_data_t)*(MAX_BH_BUFF+1)),GFP_ATOMIC);
+ chan->bh_head = kzalloc((sizeof(bh_data_t)*(MAX_BH_BUFF+1)),GFP_ATOMIC);
if (chan->bh_head == NULL){
printk(KERN_INFO "%s: ERROR, failed to allocate memory ! BH_BUFFERS !\n",
@@ -1202,7 +1200,6 @@ static int if_open(struct net_device* de
return -ENOBUFS;
}
- memset(chan->bh_head,0,(sizeof(bh_data_t)*(MAX_BH_BUFF+1)));
atomic_set(&chan->bh_buff_used, 0);
/* Increment the number of interfaces */
--- linux-2.6.17-rc1/drivers/net/wan/sdlamain.c.orig 2006-04-04 12:40:20.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/wan/sdlamain.c 2006-04-04 12:40:43.000000000 +0200
@@ -257,14 +257,12 @@ static int __init wanpipe_init(void)
}
/* Verify number of cards and allocate adapter data space */
- card_array = kmalloc(sizeof(sdla_t) * ncards, GFP_KERNEL);
+ card_array = kcalloc(ncards, sizeof(sdla_t), GFP_KERNEL);
if (card_array == NULL) {
destroy_workqueue(wanpipe_wq);
return -ENOMEM;
}
- memset(card_array, 0, sizeof(sdla_t) * ncards);
-
/* Register adapters with WAN router */
for (cnt = 0; cnt < ncards; ++ cnt) {
sdla_t* card = &card_array[cnt];
--- linux-2.6.17-rc1/drivers/net/wan/sealevel.c.orig 2006-04-04 12:40:51.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/wan/sealevel.c 2006-04-04 12:41:01.000000000 +0200
@@ -270,11 +270,10 @@ static __init struct slvl_board *slvl_in
return NULL;
}
- b = kmalloc(sizeof(struct slvl_board), GFP_KERNEL);
+ b = kzalloc(sizeof(struct slvl_board), GFP_KERNEL);
if(!b)
goto fail3;
- memset(b, 0, sizeof(*b));
if (!(b->dev[0]= slvl_alloc(iobase, irq)))
goto fail2;
--- linux-2.6.17-rc1/drivers/net/wan/wanpipe_multppp.c.orig 2006-04-04 12:41:10.000000000 +0200
+++ linux-2.6.17-rc1/drivers/net/wan/wanpipe_multppp.c 2006-04-04 12:41:22.000000000 +0200
@@ -539,13 +539,11 @@ static int new_if(struct wan_device* wan
}
/* allocate and initialize private data */
- chdlc_priv_area = kmalloc(sizeof(chdlc_private_area_t), GFP_KERNEL);
+ chdlc_priv_area = kzalloc(sizeof(chdlc_private_area_t), GFP_KERNEL);
if(chdlc_priv_area == NULL)
return -ENOMEM;
- memset(chdlc_priv_area, 0, sizeof(chdlc_private_area_t));
-
chdlc_priv_area->card = card;
/* initialize data */
[-- Attachment #2: Type: text/plain, Size: 168 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply
* Re: [RFC: 2.6 patch] remove drivers/net/hydra.h
From: Geert Uytterhoeven @ 2006-04-04 16:49 UTC (permalink / raw)
To: Adrian Bunk
Cc: Ciaran Farrell, Linux Kernel Development, netdev, Jeff Garzik,
linux-m68k
In-Reply-To: <20060404162948.GM6529@stusta.de>
On Tue, 4 Apr 2006, Adrian Bunk wrote:
> On Tue, Apr 04, 2006 at 03:27:59PM +0200, Ciaran Farrell wrote:
> > We were discussing this topic again and thought it should be reported here. As
> > you are probably aware, the file
> >
> > linux-2.6.16.tar.bz2/linux-2.6.16/drivers/net/hydra.h
> >
> > contains a BSD 4 license.
> >...
>
> The interesting point is that the file seems to be complete unused.
Apparently we forgot to remove it, when hydra.c was rewritten back in 2000 and
started to rely on 8390.h instead.
> Are there any objections against the patch below to simply remove it?
No.
> > cheers
> >
> > CFarrell
>
> cu
> Adrian
>
>
> <-- snip -->
>
>
> This patch removes drivers/net/hydra.h that is both unused and covered
> by a 4 clause BSD licence (not by the UCB).
>
> Signed-off-by: Adrian Bunk <bunk@stusta.de>
Acked-By: Geert Uytterhoeven <geert@linux-m68k.org>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply
* bcm43xx_power.c: uninitialized variable used
From: Adrian Bunk @ 2006-04-04 18:44 UTC (permalink / raw)
To: Martin Langer, Stefano Brivio, Michael Buesch, Danny van Dyk,
Andreas Jaggi
Cc: jgarzik, netdev, linux-kernel, linville
The Coverity checker found this case where the variable "tmp" is used
uninitialized:
<-- snip -->
...
static int bcm43xx_pctl_clockfreqlimit(struct bcm43xx_private *bcm,
int get_max)
{
int limit = 0;
int divisor;
int selection;
int err;
u32 tmp;
struct bcm43xx_coreinfo *old_core;
if (!(bcm->chipcommon_capabilities & BCM43xx_CAPABILITIES_PCTL))
goto out;
old_core = bcm->current_core;
err = bcm43xx_switch_core(bcm, &bcm->core_chipcommon);
if (err)
goto out;
if (bcm->current_core->rev < 6) {
...
} else if (bcm->current_core->rev < 10) {
selection = (tmp & 0x07);
...
<-- snip -->
cu
Adrian
--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed
^ permalink raw reply
* bcm43xx_sysfs.c: strange code
From: Adrian Bunk @ 2006-04-04 18:44 UTC (permalink / raw)
To: Michael Buesch; +Cc: jgarzik, netdev, linux-kernel, linville
The Coverity checker spotted the following strange code:
<-- snip -->
static ssize_t bcm43xx_attr_interfmode_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
...
err = 0;
bcm43xx_unlock(bcm, flags);
return err ? err : count;
}
...
static ssize_t bcm43xx_attr_preamble_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
...
err = 0;
bcm43xx_unlock(bcm, flags);
return err ? err : count;
}
...
static ssize_t bcm43xx_attr_preamble_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
...
err = 0;
bcm43xx_unlock(bcm, flags);
return err ? err : count;
}
...
<-- snip -->
cu
Adrian
--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed
^ permalink raw reply
* [2.6 patch] bcm43xx_phy.c: fix a memory leak
From: Adrian Bunk @ 2006-04-04 18:56 UTC (permalink / raw)
To: Martin Langer, Stefano Brivio, Michael Buesch, Danny van Dyk,
Andreas Jaggi
Cc: jgarzik, netdev, linux-kernel, linville
This patch fixes a memory leak spotted by the Coverity checker.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
---
drivers/net/wireless/bcm43xx/bcm43xx_phy.c | 1 +
1 file changed, 1 insertion(+)
--- linux-2.6.17-rc1-mm1-full/drivers/net/wireless/bcm43xx/bcm43xx_phy.c.old 2006-04-04 19:43:04.000000000 +0200
+++ linux-2.6.17-rc1-mm1-full/drivers/net/wireless/bcm43xx/bcm43xx_phy.c 2006-04-04 19:43:38.000000000 +0200
@@ -2143,22 +2143,23 @@ int bcm43xx_phy_init_tssi2dbm_table(stru
dyn_tssi2dbm = kmalloc(64, GFP_KERNEL);
if (dyn_tssi2dbm == NULL) {
printk(KERN_ERR PFX "Could not allocate memory"
"for tssi2dbm table\n");
return -ENOMEM;
}
for (idx = 0; idx < 64; idx++)
if (bcm43xx_tssi2dbm_entry(dyn_tssi2dbm, idx, pab0, pab1, pab2)) {
phy->tssi2dbm = NULL;
printk(KERN_ERR PFX "Could not generate "
"tssi2dBm table\n");
+ kfree(dyn_tssi2dbm);
return -ENODEV;
}
phy->tssi2dbm = dyn_tssi2dbm;
phy->dyn_tssi_tbl = 1;
} else {
/* pabX values not set in SPROM. */
switch (phy->type) {
case BCM43xx_PHYTYPE_A:
/* APHY needs a generated table. */
phy->tssi2dbm = NULL;
printk(KERN_ERR PFX "Could not generate tssi2dBm "
^ permalink raw reply
* [2.6 patch] net/core/net-sysfs.c: fix an off-by-21-or-49 error
From: Adrian Bunk @ 2006-04-04 19:07 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
This patch fixes an off-by-21-or-49 error ;-) spotted by the Coverity
checker.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
--- linux-2.6.17-rc1-mm1-full/net/core/net-sysfs.c.old 2006-04-04 20:36:32.000000000 +0200
+++ linux-2.6.17-rc1-mm1-full/net/core/net-sysfs.c 2006-04-04 20:36:49.000000000 +0200
@@ -165,7 +165,7 @@ static ssize_t show_operstate(struct cla
operstate = IF_OPER_DOWN;
read_unlock(&dev_base_lock);
- if (operstate >= sizeof(operstates))
+ if (operstate >= ARRAY_SIZE(operstates))
return -EINVAL; /* should not happen */
return sprintf(buf, "%s\n", operstates[operstate]);
^ permalink raw reply
* [2.6 patch] drivers/net/tg3.c: fix a memory leak
From: Adrian Bunk @ 2006-04-04 19:09 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
This patch fixes a memory leak (buf wasn't freed) spotted by the
Coverity checker.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
---
drivers/net/tg3.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
--- linux-2.6.17-rc1-mm1-full/drivers/net/tg3.c.old 2006-04-04 19:53:24.000000000 +0200
+++ linux-2.6.17-rc1-mm1-full/drivers/net/tg3.c 2006-04-04 19:54:40.000000000 +0200
@@ -8031,15 +8031,19 @@ static int tg3_test_nvram(struct tg3 *tp
if (cpu_to_be32(buf[0]) != TG3_EEPROM_MAGIC) {
u8 *buf8 = (u8 *) buf, csum8 = 0;
for (i = 0; i < size; i++)
csum8 += buf8[i];
- if (csum8 == 0)
- return 0;
- return -EIO;
+ if (csum8 == 0) {
+ err = 0;
+ goto out;
+ }
+
+ err = -EIO;
+ goto out;
}
/* Bootstrap checksum at offset 0x10 */
csum = calc_crc((unsigned char *) buf, 0x10);
if(csum != cpu_to_le32(buf[0x10/4]))
goto out;
^ permalink raw reply
* Re: [NETFILTER]: Fix fragmentation issues with bridge netfilter
From: David S. Miller @ 2006-04-04 20:42 UTC (permalink / raw)
To: kaber; +Cc: netdev, netfilter-devel, bdschuym
In-Reply-To: <44312671.3090904@trash.net>
From: Patrick McHardy <kaber@trash.net>
Date: Mon, 03 Apr 2006 15:43:13 +0200
> Fix a regression from the netfilter/IPsec patches with bridging.
> Bart, please review this patch, if everything is fine I think it
> should also go in -stable.
Applied, thanks Patrick. Please submit this to -stable.
^ permalink raw reply
* [patch 24/26] hostap: Fix EAPOL frame encryption
From: gregkh @ 2006-04-05 0:01 UTC (permalink / raw)
To: linux-kernel, stable, John W. Linville
Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
Dave Jones, Chuck Wolber, torvalds, akpm, alan, netdev,
Jouni Malinen
In-Reply-To: <20060404235927.GA27049@kroah.com>
[-- Attachment #1: hostap_fix_eapol_crypt.patch --]
[-- Type: text/plain, Size: 1002 bytes --]
Fixed encrypted of EAPOL frames from wlan#ap interface (hostapd). This
was broken when moving to use new frame control field defines in
net/ieee80211.h. hostapd uses Protected flag, not protocol version
(which was cleared in this function anyway). This fixes WPA group key
handshake and re-authentication.
http://hostap.epitest.fi/bugz/show_bug.cgi?id=126
Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>
---
drivers/net/wireless/hostap/hostap_80211_tx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- linux-2.6.16.1.orig/drivers/net/wireless/hostap/hostap_80211_tx.c
+++ linux-2.6.16.1/drivers/net/wireless/hostap/hostap_80211_tx.c
@@ -469,7 +469,7 @@ int hostap_master_start_xmit(struct sk_b
}
if (local->ieee_802_1x && meta->ethertype == ETH_P_PAE && tx.crypt &&
- !(fc & IEEE80211_FCTL_VERS)) {
+ !(fc & IEEE80211_FCTL_PROTECTED)) {
no_encrypt = 1;
PDEBUG(DEBUG_EXTRA2, "%s: TX: IEEE 802.1X - passing "
"unencrypted EAPOL frame\n", dev->name);
--
^ permalink raw reply
* Re: [NETFILTER]: Fix fragmentation issues with bridge netfilter
From: Patrick McHardy @ 2006-04-05 9:31 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, netfilter-devel, bdschuym
In-Reply-To: <20060404.134255.108672274.davem@davemloft.net>
David S. Miller wrote:
> From: Patrick McHardy <kaber@trash.net>
> Date: Mon, 03 Apr 2006 15:43:13 +0200
>
>
>>Fix a regression from the netfilter/IPsec patches with bridging.
>>Bart, please review this patch, if everything is fine I think it
>>should also go in -stable.
>
>
> Applied, thanks Patrick. Please submit this to -stable.
Done.
^ permalink raw reply
* [PATCH] [IPSEC] Avoid null pointer dereference in xfrm4_rcv_encap
From: Dave Kleikamp @ 2006-04-05 14:59 UTC (permalink / raw)
To: Herbert Xu, David S. Miller; +Cc: netdev, linux-kernel
I'm getting a panic that I've traced back to this changeset:
http://www.kernel.org/git/gitweb.cgi?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e695633e21ffb6a443a8c2f8b3f095c7f1a48eb0
xfrm4_rcv_encap dereferences x->encap without testing it for null.
Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
--- linux-2.6.17-rc1-mm1/net/ipv4/xfrm4_input.c.orig 2006-04-04
07:37:23.444068000 -0500
+++ linux-2.6.17-rc1-mm1/net/ipv4/xfrm4_input.c 2006-04-05
09:01:08.798510500 -0500
@@ -90,7 +90,7 @@ int xfrm4_rcv_encap(struct sk_buff *skb,
if (unlikely(x->km.state != XFRM_STATE_VALID))
goto drop_unlock;
- if (x->encap->encap_type != encap_type)
+ if (x->encap && (x->encap->encap_type != encap_type))
goto drop_unlock;
if (x->props.replay_window && xfrm_replay_check(x, seq))
--
David Kleikamp
IBM Linux Technology Center
^ permalink raw reply
* Re: [PATCH] [IPSEC] Avoid null pointer dereference in xfrm4_rcv_encap
From: Dave Kleikamp @ 2006-04-05 15:41 UTC (permalink / raw)
To: Herbert Xu; +Cc: David S. Miller, netdev, linux-kernel
In-Reply-To: <1144249178.10340.5.camel@kleikamp.austin.ibm.com>
Never mind. Somehow I missed Herbert's patch for this in the netdev
archives.
--
David Kleikamp
IBM Linux Technology Center
^ permalink raw reply
* [2.6 patch] drivers/char/random.c: unexport secure_ipv6_port_ephemeral
From: Adrian Bunk @ 2006-04-05 16:36 UTC (permalink / raw)
To: mpm; +Cc: linux-kernel, netdev
This patch removes the unused EXPORT_SYMBOL(secure_ipv6_port_ephemeral).
Signed-off-by: Adrian Bunk <bunk@stusta.de>
--- linux-2.6.17-rc1-mm1-full/drivers/char/random.c.old 2006-04-05 17:00:04.000000000 +0200
+++ linux-2.6.17-rc1-mm1-full/drivers/char/random.c 2006-04-05 17:00:22.000000000 +0200
@@ -1584,7 +1584,6 @@
return twothirdsMD4Transform(daddr, hash);
}
-EXPORT_SYMBOL(secure_ipv6_port_ephemeral);
#endif
#if defined(CONFIG_IP_DCCP) || defined(CONFIG_IP_DCCP_MODULE)
^ permalink raw reply
* [2.6 patch] net/wanrouter/wanmain.c: cleanups
From: Adrian Bunk @ 2006-04-05 17:06 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
This patch contains the following cleanups:
- make the following needlessly global functions static:
- lock_adapter_irq()
- unlock_adapter_irq()
- #if 0 the following unused global functions:
- wanrouter_encapsulate()
- wanrouter_type_trans()
Signed-off-by: Adrian Bunk <bunk@stusta.de>
---
include/linux/wanrouter.h | 8 --------
net/wanrouter/wanmain.c | 17 ++++++++---------
2 files changed, 8 insertions(+), 17 deletions(-)
--- linux-2.6.17-rc1-mm1-full/include/linux/wanrouter.h.old 2006-04-05 17:03:07.000000000 +0200
+++ linux-2.6.17-rc1-mm1-full/include/linux/wanrouter.h 2006-04-05 17:15:20.000000000 +0200
@@ -516,9 +516,6 @@
/* Public functions available for device drivers */
extern int register_wan_device(struct wan_device *wandev);
extern int unregister_wan_device(char *name);
-__be16 wanrouter_type_trans(struct sk_buff *skb, struct net_device *dev);
-int wanrouter_encapsulate(struct sk_buff *skb, struct net_device *dev,
- unsigned short type);
/* Proc interface functions. These must not be called by the drivers! */
extern int wanrouter_proc_init(void);
@@ -527,11 +524,6 @@
extern int wanrouter_proc_delete(struct wan_device *wandev);
extern int wanrouter_ioctl( struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg);
-extern void lock_adapter_irq(spinlock_t *lock, unsigned long *smp_flags);
-extern void unlock_adapter_irq(spinlock_t *lock, unsigned long *smp_flags);
-
-
-
/* Public Data */
/* list of registered devices */
extern struct wan_device *wanrouter_router_devlist;
--- linux-2.6.17-rc1-mm1-full/net/wanrouter/wanmain.c.old 2006-04-05 17:03:39.000000000 +0200
+++ linux-2.6.17-rc1-mm1-full/net/wanrouter/wanmain.c 2006-04-05 17:18:32.000000000 +0200
@@ -144,8 +144,8 @@
static struct wan_device *wanrouter_find_device(char *name);
static int wanrouter_delete_interface(struct wan_device *wandev, char *name);
-void lock_adapter_irq(spinlock_t *lock, unsigned long *smp_flags);
-void unlock_adapter_irq(spinlock_t *lock, unsigned long *smp_flags);
+static void lock_adapter_irq(spinlock_t *lock, unsigned long *smp_flags);
+static void unlock_adapter_irq(spinlock_t *lock, unsigned long *smp_flags);
@@ -162,8 +162,8 @@
* Organize Unique Identifiers for encapsulation/decapsulation
*/
-static unsigned char wanrouter_oui_ether[] = { 0x00, 0x00, 0x00 };
#if 0
+static unsigned char wanrouter_oui_ether[] = { 0x00, 0x00, 0x00 };
static unsigned char wanrouter_oui_802_2[] = { 0x00, 0x80, 0xC2 };
#endif
@@ -304,6 +304,8 @@
return 0;
}
+#if 0
+
/*
* Encapsulate packet.
*
@@ -399,6 +401,7 @@
return ethertype;
}
+#endif /* 0 */
/*
* WAN device IOCTL.
@@ -860,23 +863,19 @@
return 0;
}
-void lock_adapter_irq(spinlock_t *lock, unsigned long *smp_flags)
+static void lock_adapter_irq(spinlock_t *lock, unsigned long *smp_flags)
{
spin_lock_irqsave(lock, *smp_flags);
}
-void unlock_adapter_irq(spinlock_t *lock, unsigned long *smp_flags)
+static void unlock_adapter_irq(spinlock_t *lock, unsigned long *smp_flags)
{
spin_unlock_irqrestore(lock, *smp_flags);
}
EXPORT_SYMBOL(register_wan_device);
EXPORT_SYMBOL(unregister_wan_device);
-EXPORT_SYMBOL(wanrouter_encapsulate);
-EXPORT_SYMBOL(wanrouter_type_trans);
-EXPORT_SYMBOL(lock_adapter_irq);
-EXPORT_SYMBOL(unlock_adapter_irq);
MODULE_LICENSE("GPL");
^ permalink raw reply
* Re: [PATCH] [IPSEC] Avoid null pointer dereference in xfrm4_rcv_encap
From: Herbert Xu @ 2006-04-05 17:10 UTC (permalink / raw)
To: Dave Kleikamp; +Cc: David S. Miller, netdev, linux-kernel
In-Reply-To: <1144249178.10340.5.camel@kleikamp.austin.ibm.com>
On Wed, Apr 05, 2006 at 09:59:38AM -0500, Dave Kleikamp wrote:
> I'm getting a panic that I've traced back to this changeset:
> http://www.kernel.org/git/gitweb.cgi?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e695633e21ffb6a443a8c2f8b3f095c7f1a48eb0
>
> xfrm4_rcv_encap dereferences x->encap without testing it for null.
The fix for this bug has just been merged. Thanks,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* Re: [2.6 patch] drivers/char/random.c: unexport secure_ipv6_port_ephemeral
From: Stephen Hemminger @ 2006-04-05 17:11 UTC (permalink / raw)
To: Adrian Bunk; +Cc: mpm, linux-kernel, netdev
In-Reply-To: <20060405163610.GG8673@stusta.de>
On Wed, 5 Apr 2006 18:36:10 +0200
Adrian Bunk <bunk@stusta.de> wrote:
> This patch removes the unused EXPORT_SYMBOL(secure_ipv6_port_ephemeral).
>
> Signed-off-by: Adrian Bunk <bunk@stusta.de>
>
> --- linux-2.6.17-rc1-mm1-full/drivers/char/random.c.old 2006-04-05 17:00:04.000000000 +0200
> +++ linux-2.6.17-rc1-mm1-full/drivers/char/random.c 2006-04-05 17:00:22.000000000 +0200
> @@ -1584,7 +1584,6 @@
>
> return twothirdsMD4Transform(daddr, hash);
> }
> -EXPORT_SYMBOL(secure_ipv6_port_ephemeral);
> #endif
>
> #if defined(CONFIG_IP_DCCP) || defined(CONFIG_IP_DCCP_MODULE)
>
> -
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
NAK
If IPV6 is built as a module, then it is needed.
^ permalink raw reply
* Re: [2.6 patch] drivers/char/random.c: unexport secure_ipv6_port_ephemeral
From: Adrian Bunk @ 2006-04-05 17:19 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: mpm, linux-kernel, netdev
In-Reply-To: <20060405101111.0edc161a@localhost.localdomain>
On Wed, Apr 05, 2006 at 10:11:11AM -0700, Stephen Hemminger wrote:
> On Wed, 5 Apr 2006 18:36:10 +0200
> Adrian Bunk <bunk@stusta.de> wrote:
>
> > This patch removes the unused EXPORT_SYMBOL(secure_ipv6_port_ephemeral).
> >
> > Signed-off-by: Adrian Bunk <bunk@stusta.de>
> >
> > --- linux-2.6.17-rc1-mm1-full/drivers/char/random.c.old 2006-04-05 17:00:04.000000000 +0200
> > +++ linux-2.6.17-rc1-mm1-full/drivers/char/random.c 2006-04-05 17:00:22.000000000 +0200
> > @@ -1584,7 +1584,6 @@
> >
> > return twothirdsMD4Transform(daddr, hash);
> > }
> > -EXPORT_SYMBOL(secure_ipv6_port_ephemeral);
> > #endif
> >
> > #if defined(CONFIG_IP_DCCP) || defined(CONFIG_IP_DCCP_MODULE)
> >
> > -
> > To unsubscribe from this list: send the line "unsubscribe netdev" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
>
> NAK
>
> If IPV6 is built as a module, then it is needed.
No, it isn't:
obj-$(subst m,y,$(CONFIG_IPV6)) += inet6_hashtables.o
cu
Adrian
--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed
^ permalink raw reply
* [PATCH] net: Broadcast ARP packets on link local addresses (Version2).
From: David Daney @ 2006-04-05 21:22 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel, pgf, freek
From: David Daney
Here is a new version of the patch I sent March 31. For background,
this is my description from the first patch:
> When an internet host joins a network where there is no DHCP server,
> it may auto-allocate an IP address by the method described in RFC
> 3927. There are several user space daemons available that implement
> most of the protocol (zcip, busybox, ...). The kernel's APR driver
> should function in the normal manner except that it is required to
> broadcast all ARP packets that it originates in the link local address
> space (169.254.0.0/16). RFC 3927 section 2.5 explains the requirement.
> The current ARP code is non-compliant because it does not broadcast
> some ARP packets as required by RFC 3927.
> This patch to net/ipv4/arp.c checks the source address of all ARP
> packets and if the fall in 169.254.0.0/16, they are broadcast instead
> of unicast.
All of that is still true.
The changes in this version are that it tests the source IP address
instead of the destination. The test now matches the test described
in the RFC. Also a small cleanup as suggested by Herbert Xu.
Some comments on the first version of the patch suggested that I do
'X' instead. Where 'X' was behavior different than that REQUIRED by
the RFC (the RFC's always seem to capitalize the word 'required').
The reason that I implemented the behavior required by the RFC is so
that a device running the kernel can pass compliance tests that
mandate RFC compliance.
If the patch is deemed good and correct, great, please apply it.
Othwise comments about how to improve it are always welcome. But keep
in mind that I would like to end up with something that complies with
the RFC.
This patch is against 2.6.16.1
Signed-off-by: David Daney <ddaney@avtrex.com>
---
--- net/ipv4/arp.c.orig 2006-03-31 13:44:50.000000000 -0800
+++ net/ipv4/arp.c 2006-04-05 13:33:19.000000000 -0700
@@ -690,6 +690,11 @@ void arp_send(int type, int ptype, u32 d
if (dev->flags&IFF_NOARP)
return;
+ /* If link local address (169.254.0.0/16) we must broadcast
+ * the ARP packet. See RFC 3927 section 2.5 for details. */
+ if ((src_ip & htonl(0xFFFF0000UL)) == htonl(0xA9FE0000UL))
+ dest_hw = NULL;
+
skb = arp_create(type, ptype, dest_ip, dev, src_ip,
dest_hw, src_hw, target_hw);
if (skb == NULL) {
^ permalink raw reply
* Re: [e1000 debug] KERNEL: assertion (!sk_forward_alloc) failed...
From: Jesse Brandeburg @ 2006-04-05 22:05 UTC (permalink / raw)
To: Boris B. Zhmurov
Cc: Phil Oester, Mark Nipper, Herbert Xu, David S. Miller,
Brandeburg, Jesse, jrlundgren, cat, djani22, yoseph.basri, mykleb,
olel, michal, chris, netdev, jesse.brandeburg, E1000-devel,
Andi Kleen, Jeff Garzik
In-Reply-To: <44319AFF.4090101@kernelpanic.ru>
On Mon, 3 Apr 2006, Boris B. Zhmurov wrote:
>
> Hello, Phil Oester.
>
> On 04.04.2006 01:39 you said the following:
>
> > On Mon, Apr 03, 2006 at 04:01:23PM -0500, Mark Nipper wrote:
> >
> >> After three days and some hours, I finally saw another
> >>event:
> >
> >
> > Ack, same here. Looked hopeful, but finally saw the error today.
> >
> > Phil
>
>
> [root@msk4 ~]# dmesg |grep assertion |wc -l
> 176
>
> [root@msk4 ~]# uptime
> 02:00:01 up 3 days, 7:31, 2 users, load average: 1.32, 0.59, 0.41
>
Some earlier had proposed that this problem appeared in 2.6.12, which was
the introduction of the 6.X series e1000 driver.
If someone would like to, can they try the 5.6.10.1 driver from the
2.6.11.X kernel?
I'd like it if you can stick with your current kernel, and if you have
trouble building the driver, go ahead and try the 5.6.10.1 driver from
http://prdownloads.sf.net/e1000
I'll also send a patch today to back-rev the xmit routine to the 5.6.10.1
state.
Jesse
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
^ permalink raw reply
* [PATCH] IrDA: smcinit merged into smsc-ircc driver
From: Samuel Ortiz @ 2006-04-05 23:21 UTC (permalink / raw)
To: ext David S. Miller
Cc: netdev-u79uwXL29TY76Z2rM5mHXA, IrDA users, Jean Tourrilhes
Hi David,
This patch integrates the smcinit code into the smsc-ircc driver.
Some laptops have their smsc-ircc chip not properly configured by the BIOS and needs some preconfiguration. Currently, this can be done from userspace with smcinit, a utility that comes with the irda-utils package. It messes with ioports and PCI settings, from userspace.
Now with this patch, if we happen to be on one of the known to be faulty laptops, we preconfigure the chip from the driver.
Patch from Linus Walleij <triad-HEm3bjczhZmzQB+pC5nmwQ@public.gmane.org>
Signed-off-by: Samuel Ortiz <samuel.ortiz-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
diff --git a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c
index ec94ecd..f6d98b4 100644
--- a/drivers/net/irda/smsc-ircc2.c
+++ b/drivers/net/irda/smsc-ircc2.c
@@ -11,6 +11,7 @@
* Copyright (c) 2002 Daniele Peri
* All Rights Reserved.
* Copyright (c) 2002 Jean Tourrilhes
+ * Copyright (c) 2006 Linus Walleij
*
*
* Based on smc-ircc.c:
@@ -61,6 +62,9 @@
#include <linux/spinlock.h>
#include <linux/pm.h>
+#ifdef CONFIG_PCI
+#include <linux/pci.h>
+#endif
#include <net/irda/wrapper.h>
#include <net/irda/irda.h>
@@ -100,6 +104,22 @@ MODULE_PARM_DESC(ircc_transceiver, "Tran
/* Types */
+#ifdef CONFIG_PCI
+struct smsc_ircc_subsystem_configuration {
+ unsigned short vendor; /* PCI vendor ID */
+ unsigned short device; /* PCI vendor ID */
+ unsigned short subvendor; /* PCI subsystem vendor ID */
+ unsigned short subdevice; /* PCI sybsystem device ID */
+ unsigned short sir_io; /* I/O port for SIR */
+ unsigned short fir_io; /* I/O port for FIR */
+ unsigned char fir_irq; /* FIR IRQ */
+ unsigned char fir_dma; /* FIR DMA */
+ unsigned short cfg_base; /* I/O port for chip configuration */
+ int (*preconfigure)(struct pci_dev *dev, struct smsc_ircc_subsystem_configuration *conf); /* Preconfig function */
+ const char *name; /* name shown as info */
+};
+#endif
+
struct smsc_transceiver {
char *name;
void (*set_for_speed)(int fir_base, u32 speed);
@@ -202,6 +222,16 @@ static int __init smsc_superio_flat(cons
static int __init smsc_superio_paged(const struct smsc_chip *chips, unsigned short cfg_base, char *type);
static int __init smsc_superio_fdc(unsigned short cfg_base);
static int __init smsc_superio_lpc(unsigned short cfg_base);
+#ifdef CONFIG_PCI
+static int __init preconfigure_smsc_chip(struct smsc_ircc_subsystem_configuration *conf);
+static int __init preconfigure_through_82801(struct pci_dev *dev, struct smsc_ircc_subsystem_configuration *conf);
+static int __init preconfigure_through_ali(struct pci_dev *dev, struct smsc_ircc_subsystem_configuration *conf);
+static int __init smsc_ircc_preconfigure_subsystems(unsigned short ircc_cfg,
+ unsigned short ircc_fir,
+ unsigned short ircc_sir,
+ unsigned char ircc_dma,
+ unsigned char ircc_irq);
+#endif
/* Transceivers specific functions */
@@ -353,6 +383,13 @@ static int __init smsc_ircc_init(void)
return ret;
}
+#ifdef CONFIG_PCI
+ if (smsc_ircc_preconfigure_subsystems(ircc_cfg, ircc_fir, ircc_sir, ircc_dma, ircc_irq) < 0) {
+ /* Ignore errors from preconfiguration */
+ IRDA_ERROR("%s, Preconfiguration failed !\n", driver_name);
+ }
+#endif
+
dev_count = 0;
if (ircc_fir > 0 && ircc_sir > 0) {
@@ -2285,6 +2322,280 @@ static int __init smsc_superio_lpc(unsig
return ret;
}
+/*
+ * Look for some specific subsystem setups that need
+ * pre-configuration not properly done by the BIOS (especially laptops)
+ * This code is based in part on smcinit.c, tosh1800-smcinit.c
+ * and tosh2450-smcinit.c. The table lists the device entries
+ * for ISA bridges with an LPC (Local Peripheral Configurator)
+ * that are in turn used to configure the SMSC device with default
+ * SIR and FIR I/O ports, DMA and IRQ.
+ */
+#ifdef CONFIG_PCI
+#define PCIID_VENDOR_INTEL 0x8086
+#define PCIID_VENDOR_ALI 0x10b9
+static struct smsc_ircc_subsystem_configuration subsystem_configurations[] __devinitdata = {
+ {
+ .vendor = PCIID_VENDOR_INTEL, /* Intel 82801DBM LPC bridge */
+ .device = 0x24cc,
+ .subvendor = 0x103c,
+ .subdevice = 0x088c,
+ .sir_io = 0x02f8, /* Quite certain these are the same for nc8000 as for nc6000 */
+ .fir_io = 0x0130,
+ .fir_irq = 0x09,
+ .fir_dma = 0x03,
+ .cfg_base = 0x004e,
+ .preconfigure = preconfigure_through_82801,
+ .name = "HP nc8000",
+ },
+ {
+ .vendor = PCIID_VENDOR_INTEL, /* Intel 82801DBM LPC bridge */
+ .device = 0x24cc,
+ .subvendor = 0x103c,
+ .subdevice = 0x0890,
+ .sir_io = 0x02f8,
+ .fir_io = 0x0130,
+ .fir_irq = 0x09,
+ .fir_dma = 0x03,
+ .cfg_base = 0x004e,
+ .preconfigure = preconfigure_through_82801,
+ .name = "HP nc6000",
+ },
+ {
+ .vendor = PCIID_VENDOR_INTEL, /* Intel 82801DB/DBL (ICH4/ICH4-L) LPC Interface Bridge */
+ .device = 0x24c0,
+ .subvendor = 0x1179,
+ .subdevice = 0xffff, /* 0xffff is "any", Not sure, 0x0001 or 0x0002 */
+ .sir_io = 0x03f8,
+ .fir_io = 0x0130,
+ .fir_irq = 0x07,
+ .fir_dma = 0x01,
+ .cfg_base = 0x002e,
+ .preconfigure = preconfigure_through_82801,
+ .name = "Toshiba Satellite 2450",
+ },
+ {
+ .vendor = PCIID_VENDOR_INTEL, /* Intel 82801CAM ISA bridge */
+ .device = 0x248c, /* Some use 24cc? */
+ .subvendor = 0x1179,
+ .subdevice = 0xffff, /* 0xffff is "any", Not sure, 0x0001 or 0x0002 */
+ .sir_io = 0x03f8,
+ .fir_io = 0x0130,
+ .fir_irq = 0x03,
+ .fir_dma = 0x03,
+ .cfg_base = 0x002e,
+ .preconfigure = preconfigure_through_82801,
+ .name = "Toshiba Satellite 5100/5200, Tecra 9100",
+ },
+ {
+ .vendor = PCIID_VENDOR_ALI, /* ALi M1533/M1535 PCI to ISA Bridge [Aladdin IV/V/V+] */
+ .device = 0x1533,
+ .subvendor = 0x1179,
+ .subdevice = 0xffff, /* 0xffff is "any", Not sure, 0x0001 or 0x0002 */
+ .sir_io = 0x02e8,
+ .fir_io = 0x02f8,
+ .fir_irq = 0x07,
+ .fir_dma = 0x03,
+ .cfg_base = 0x002e,
+ .preconfigure = preconfigure_through_ali,
+ .name = "Toshiba Satellite 1800",
+ },
+ { } // Terminator
+};
+
+
+/*
+ * This sets up the basic SMSC parameters (FIR port, SIR port, FIR DMA, FIR IRQ)
+ * through the chip configuration port.
+ */
+static int __init preconfigure_smsc_chip(struct smsc_ircc_subsystem_configuration *conf)
+{
+ unsigned short iobase = conf->cfg_base;
+ unsigned char tmpbyte;
+
+ outb(LPC47N227_CFGACCESSKEY, iobase); // enter configuration state
+ outb(SMSCSIOFLAT_DEVICEID_REG, iobase); // set for device ID
+ tmpbyte = inb(iobase +1); // Read device ID
+ IRDA_DEBUG(0, "Detected Chip id: 0x%02x, setting up registers...\n",tmpbyte);
+
+ /* Disable UART1 and set up SIR I/O port */
+ outb(0x24, iobase); // select CR24 - UART1 base addr
+ outb(0x00, iobase + 1); // disable UART1
+ outb(SMSCSIOFLAT_UART2BASEADDR_REG, iobase); // select CR25 - UART2 base addr
+ outb( (conf->sir_io >> 2), iobase + 1); // bits 2-9 of 0x3f8
+ tmpbyte = inb(iobase + 1);
+ if (tmpbyte != (conf->sir_io >> 2) ) {
+ IRDA_WARNING("ERROR: could not configure SIR ioport.\n");
+ return -ENXIO;
+ }
+
+ /* Set up FIR IRQ channel for UART2 */
+ outb(SMSCSIOFLAT_UARTIRQSELECT_REG, iobase); // select CR28 - UART1,2 IRQ select
+ tmpbyte = inb(iobase + 1);
+ tmpbyte &= SMSCSIOFLAT_UART1IRQSELECT_MASK; // Do not touch the UART1 portion
+ tmpbyte |= (conf->fir_irq & SMSCSIOFLAT_UART2IRQSELECT_MASK);
+ outb(tmpbyte, iobase + 1);
+ tmpbyte = inb(iobase + 1) & SMSCSIOFLAT_UART2IRQSELECT_MASK;
+ if (tmpbyte != conf->fir_irq) {
+ IRDA_WARNING("ERROR: could not configure FIR IRQ channel.\n");
+ return -ENXIO;
+ }
+
+ /* Set up FIR I/O port */
+ outb(SMSCSIOFLAT_FIRBASEADDR_REG, iobase); // CR2B - SCE (FIR) base addr
+ outb((conf->fir_io >> 3), iobase + 1);
+ tmpbyte = inb(iobase + 1);
+ if (tmpbyte != (conf->fir_io >> 3) ) {
+ IRDA_WARNING("ERROR: could not configure FIR I/O port.\n");
+ return -ENXIO;
+ }
+
+ /* Set up FIR DMA channel */
+ outb(SMSCSIOFLAT_FIRDMASELECT_REG, iobase); // CR2C - SCE (FIR) DMA select
+ outb((conf->fir_dma & LPC47N227_FIRDMASELECT_MASK), iobase + 1); // DMA
+ tmpbyte = inb(iobase + 1) & LPC47N227_FIRDMASELECT_MASK;
+ if (tmpbyte != (conf->fir_dma & LPC47N227_FIRDMASELECT_MASK)) {
+ IRDA_WARNING("ERROR: could not configure FIR DMA channel.\n");
+ return -ENXIO;
+ }
+
+ outb(SMSCSIOFLAT_UARTMODE0C_REG, iobase); // CR0C - UART mode
+ tmpbyte = inb(iobase + 1);
+ tmpbyte &= ~SMSCSIOFLAT_UART2MODE_MASK | SMSCSIOFLAT_UART2MODE_VAL_IRDA;
+ outb(tmpbyte, iobase + 1); // enable IrDA (HPSIR) mode, high speed
+
+ outb(LPC47N227_APMBOOTDRIVE_REG, iobase); // CR07 - Auto Pwr Mgt/boot drive sel
+ tmpbyte = inb(iobase + 1);
+ outb(tmpbyte | LPC47N227_UART2AUTOPWRDOWN_MASK, iobase + 1); // enable UART2 autopower down
+
+ /* This one was not part of tosh1800 */
+ outb(0x0a, iobase); // CR0a - ecp fifo / ir mux
+ tmpbyte = inb(iobase + 1);
+ outb(tmpbyte | 0x40, iobase + 1); // send active device to ir port
+
+ outb(LPC47N227_UART12POWER_REG, iobase); // CR02 - UART 1,2 power
+ tmpbyte = inb(iobase + 1);
+ outb(tmpbyte | LPC47N227_UART2POWERDOWN_MASK, iobase + 1); // UART2 power up mode, UART1 power down
+
+ outb(LPC47N227_FDCPOWERVALIDCONF_REG, iobase); // CR00 - FDC Power/valid config cycle
+ tmpbyte = inb(iobase + 1);
+ outb(tmpbyte | LPC47N227_VALID_MASK, iobase + 1); // valid config cycle done
+
+ outb(LPC47N227_CFGEXITKEY, iobase); // Exit configuration
+
+ return 0;
+}
+
+/* 82801CAM registers */
+#define VID 0x00
+#define DID 0x02
+#define PIRQA_ROUT 0x60
+#define PCI_DMA_C 0x90
+#define COM_DEC 0xe0
+#define LPC_EN 0xe6
+#define GEN2_DEC 0xec
+/*
+ * Sets up the I/O range using the 82801CAM ISA bridge, 82801DBM LPC bridge or
+ * Intel 82801DB/DBL (ICH4/ICH4-L) LPC Interface Bridge. They all work the same way!
+ */
+static int __init preconfigure_through_82801(struct pci_dev *dev,
+ struct smsc_ircc_subsystem_configuration *conf)
+{
+ unsigned short tmpword;
+ int ret;
+
+ IRDA_MESSAGE("Setting up the SMSC device via the 82801 controller.\n");
+ pci_write_config_byte(dev, COM_DEC, 0x10);
+
+ /* Enable LPC */
+ pci_read_config_word(dev, LPC_EN, &tmpword); /* LPC_EN register */
+ tmpword &= 0xfffd; /* mask bit 1 */
+ tmpword |= 0x0001; /* set bit 0 : COMA addr range enable */
+ pci_write_config_word(dev, LPC_EN, tmpword);
+
+ /* Setup DMA */
+ pci_write_config_word(dev, PCI_DMA_C, 0xc0c0); /* LPC I/F DMA on, channel 3 -- rtm (?? PCI DMA ?) */
+ pci_write_config_word(dev, GEN2_DEC, 0x131); /* LPC I/F 2nd decode range */
+
+ /* Pre-configure chip */
+ ret = preconfigure_smsc_chip(conf);
+
+ /* Disable LPC */
+ pci_read_config_word(dev, LPC_EN, &tmpword); /* LPC_EN register */
+ tmpword &= 0xfffc; /* mask bit 1 and bit 0, COMA addr range disable */
+ pci_write_config_word(dev, LPC_EN, tmpword);
+ return ret;
+}
+
+static int __init preconfigure_through_ali(struct pci_dev *dev,
+ struct smsc_ircc_subsystem_configuration *conf)
+{
+ /* TODO: put in ALi 1533 configuration here. */
+ IRDA_MESSAGE("SORRY: %s has an unsupported bridge controller (ALi): not pre-configured.\n", conf->name);
+ return -ENODEV;
+}
+
+static int __init smsc_ircc_preconfigure_subsystems(unsigned short ircc_cfg,
+ unsigned short ircc_fir,
+ unsigned short ircc_sir,
+ unsigned char ircc_dma,
+ unsigned char ircc_irq)
+{
+ struct pci_dev *dev = NULL;
+ unsigned short ss_vendor = 0x0000;
+ unsigned short ss_device = 0x0000;
+ int ret = 0;
+
+ dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev);
+
+ while (dev != NULL) {
+ struct smsc_ircc_subsystem_configuration *conf;
+
+ /*
+ * Cache the subsystem vendor/device: some manufacturers fail to set
+ * this for all components, so we save it in case there is just
+ * 0x0000 0x0000 on the device we want to check.
+ */
+ if (dev->subsystem_vendor != 0x0000U) {
+ ss_vendor = dev->subsystem_vendor;
+ ss_device = dev->subsystem_device;
+ }
+ conf = subsystem_configurations;
+ for( ; conf->subvendor; conf++) {
+ if(conf->vendor == dev->vendor &&
+ conf->device == dev->device &&
+ conf->subvendor == ss_vendor && /* Sometimes these are cached values */
+ (conf->subdevice == ss_device || conf->subdevice == 0xffff)) {
+ struct smsc_ircc_subsystem_configuration tmpconf;
+
+ memcpy(&tmpconf, conf, sizeof(struct smsc_ircc_subsystem_configuration));
+
+ /* Override the default values with anything passed in as parameter */
+ if (ircc_cfg != 0)
+ tmpconf.cfg_base = ircc_cfg;
+ if (ircc_fir != 0)
+ tmpconf.fir_io = ircc_fir;
+ if (ircc_sir != 0)
+ tmpconf.sir_io = ircc_sir;
+ if (ircc_dma != 0xff)
+ tmpconf.fir_dma = ircc_dma;
+ if (ircc_irq != 0xff)
+ tmpconf.fir_irq = ircc_irq;
+
+ IRDA_MESSAGE("Detected unconfigured %s SMSC IrDA chip, pre-configuring device.\n", conf->name);
+ if (conf->preconfigure)
+ ret = conf->preconfigure(dev, &tmpconf);
+ else
+ ret = -ENODEV;
+ }
+ }
+ dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev);
+ }
+
+ return ret;
+}
+#endif // CONFIG_PCI
+
/************************************************
*
* Transceivers specific functions
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox