Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bacd3add authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
  [NET]: Fully fix the memory leaks in sys_accept().
  [NETFILTER]: iptables 32bit compat layer
  [NETFILTER]: {ip,nf}_conntrack_netlink: fix expectation notifier unregistration
  [NETFILTER]: fix ifdef for connmark support in nf_conntrack_netlink
  [NETFILTER]: x_tables: unify IPv4/IPv6 multiport match
  [NETFILTER]: x_tables: unify IPv4/IPv6 esp match
  [NET]: Fix dentry leak in sys_accept().
  [IPSEC]: Kill unused decap state structure
  [IPSEC]: Kill unused decap state argument
  [NET]: com90xx kmalloc fix
  [TG3]: Update driver version and reldate.
  [TG3]: Revert "Speed up SRAM access"
parents 29e35094 9a1875e6
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -125,11 +125,11 @@ static void __init com90xx_probe(void)
	if (!io && !irq && !shmem && !*device && com90xx_skip_probe)
	if (!io && !irq && !shmem && !*device && com90xx_skip_probe)
		return;
		return;


	shmems = kzalloc(((0x10000-0xa0000) / 0x800) * sizeof(unsigned long),
	shmems = kzalloc(((0x100000-0xa0000) / 0x800) * sizeof(unsigned long),
			 GFP_KERNEL);
			 GFP_KERNEL);
	if (!shmems)
	if (!shmems)
		return;
		return;
	iomem = kzalloc(((0x10000-0xa0000) / 0x800) * sizeof(void __iomem *),
	iomem = kzalloc(((0x100000-0xa0000) / 0x800) * sizeof(void __iomem *),
			 GFP_KERNEL);
			 GFP_KERNEL);
	if (!iomem) {
	if (!iomem) {
		kfree(shmems);
		kfree(shmems);
+25 −32
Original line number Original line Diff line number Diff line
@@ -69,8 +69,8 @@


#define DRV_MODULE_NAME		"tg3"
#define DRV_MODULE_NAME		"tg3"
#define PFX DRV_MODULE_NAME	": "
#define PFX DRV_MODULE_NAME	": "
#define DRV_MODULE_VERSION	"3.55"
#define DRV_MODULE_VERSION	"3.56"
#define DRV_MODULE_RELDATE	"Mar 27, 2006"
#define DRV_MODULE_RELDATE	"Apr 1, 2006"


#define TG3_DEF_MAC_MODE	0
#define TG3_DEF_MAC_MODE	0
#define TG3_DEF_RX_MODE		0
#define TG3_DEF_RX_MODE		0
@@ -497,40 +497,33 @@ static void tg3_write_mem(struct tg3 *tp, u32 off, u32 val)
	unsigned long flags;
	unsigned long flags;


	spin_lock_irqsave(&tp->indirect_lock, flags);
	spin_lock_irqsave(&tp->indirect_lock, flags);
	if (tp->write32 != tg3_write_indirect_reg32) {
		tw32_f(TG3PCI_MEM_WIN_BASE_ADDR, off);
		tw32_f(TG3PCI_MEM_WIN_DATA, val);

		/* Always leave this as zero. */
		tw32_f(TG3PCI_MEM_WIN_BASE_ADDR, 0);
	} else {
	pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, off);
	pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, off);
	pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_DATA, val);
	pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_DATA, val);


	/* Always leave this as zero. */
	/* Always leave this as zero. */
	pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, 0);
	pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, 0);
	}
	spin_unlock_irqrestore(&tp->indirect_lock, flags);
	spin_unlock_irqrestore(&tp->indirect_lock, flags);
}
}


static void tg3_write_mem_fast(struct tg3 *tp, u32 off, u32 val)
{
	/* If no workaround is needed, write to mem space directly */
	if (tp->write32 != tg3_write_indirect_reg32)
		tw32(NIC_SRAM_WIN_BASE + off, val);
	else
		tg3_write_mem(tp, off, val);
}

static void tg3_read_mem(struct tg3 *tp, u32 off, u32 *val)
static void tg3_read_mem(struct tg3 *tp, u32 off, u32 *val)
{
{
	unsigned long flags;
	unsigned long flags;


	spin_lock_irqsave(&tp->indirect_lock, flags);
	spin_lock_irqsave(&tp->indirect_lock, flags);
	if (tp->write32 != tg3_write_indirect_reg32) {
		tw32_f(TG3PCI_MEM_WIN_BASE_ADDR, off);
		*val = tr32(TG3PCI_MEM_WIN_DATA);

		/* Always leave this as zero. */
		tw32_f(TG3PCI_MEM_WIN_BASE_ADDR, 0);
	} else {
	pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, off);
	pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, off);
	pci_read_config_dword(tp->pdev, TG3PCI_MEM_WIN_DATA, val);
	pci_read_config_dword(tp->pdev, TG3PCI_MEM_WIN_DATA, val);


	/* Always leave this as zero. */
	/* Always leave this as zero. */
	pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, 0);
	pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, 0);
	}
	spin_unlock_irqrestore(&tp->indirect_lock, flags);
	spin_unlock_irqrestore(&tp->indirect_lock, flags);
}
}


@@ -1374,12 +1367,12 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state)
		}
		}
	}
	}


	tg3_write_sig_post_reset(tp, RESET_KIND_SHUTDOWN);

	/* Finally, set the new power state. */
	/* Finally, set the new power state. */
	pci_write_config_word(tp->pdev, pm + PCI_PM_CTRL, power_control);
	pci_write_config_word(tp->pdev, pm + PCI_PM_CTRL, power_control);
	udelay(100);	/* Delay after power state change */
	udelay(100);	/* Delay after power state change */


	tg3_write_sig_post_reset(tp, RESET_KIND_SHUTDOWN);

	return 0;
	return 0;
}
}


@@ -6547,11 +6540,11 @@ static void tg3_timer(unsigned long __opaque)
		if (tp->tg3_flags & TG3_FLAG_ENABLE_ASF) {
		if (tp->tg3_flags & TG3_FLAG_ENABLE_ASF) {
			u32 val;
			u32 val;


			tg3_write_mem(tp, NIC_SRAM_FW_CMD_MBOX,
			tg3_write_mem_fast(tp, NIC_SRAM_FW_CMD_MBOX,
					   FWCMD_NICDRV_ALIVE2);
					   FWCMD_NICDRV_ALIVE2);
			tg3_write_mem(tp, NIC_SRAM_FW_CMD_LEN_MBOX, 4);
			tg3_write_mem_fast(tp, NIC_SRAM_FW_CMD_LEN_MBOX, 4);
			/* 5 seconds timeout */
			/* 5 seconds timeout */
			tg3_write_mem(tp, NIC_SRAM_FW_CMD_DATA_MBOX, 5);
			tg3_write_mem_fast(tp, NIC_SRAM_FW_CMD_DATA_MBOX, 5);
			val = tr32(GRC_RX_CPU_EVENT);
			val = tr32(GRC_RX_CPU_EVENT);
			val |= (1 << 14);
			val |= (1 << 14);
			tw32(GRC_RX_CPU_EVENT, val);
			tw32(GRC_RX_CPU_EVENT, val);
+67 −0
Original line number Original line Diff line number Diff line
@@ -142,6 +142,12 @@ struct xt_counters_info
#define ASSERT_WRITE_LOCK(x)
#define ASSERT_WRITE_LOCK(x)
#include <linux/netfilter_ipv4/listhelp.h>
#include <linux/netfilter_ipv4/listhelp.h>


#ifdef CONFIG_COMPAT
#define COMPAT_TO_USER		1
#define COMPAT_FROM_USER	-1
#define COMPAT_CALC_SIZE	0
#endif

struct xt_match
struct xt_match
{
{
	struct list_head list;
	struct list_head list;
@@ -175,6 +181,9 @@ struct xt_match
	void (*destroy)(const struct xt_match *match, void *matchinfo,
	void (*destroy)(const struct xt_match *match, void *matchinfo,
			unsigned int matchinfosize);
			unsigned int matchinfosize);


	/* Called when userspace align differs from kernel space one */
	int (*compat)(void *match, void **dstptr, int *size, int convert);

	/* Set this to THIS_MODULE if you are a module, otherwise NULL */
	/* Set this to THIS_MODULE if you are a module, otherwise NULL */
	struct module *me;
	struct module *me;


@@ -220,6 +229,9 @@ struct xt_target
	void (*destroy)(const struct xt_target *target, void *targinfo,
	void (*destroy)(const struct xt_target *target, void *targinfo,
			unsigned int targinfosize);
			unsigned int targinfosize);


	/* Called when userspace align differs from kernel space one */
	int (*compat)(void *target, void **dstptr, int *size, int convert);

	/* Set this to THIS_MODULE if you are a module, otherwise NULL */
	/* Set this to THIS_MODULE if you are a module, otherwise NULL */
	struct module *me;
	struct module *me;


@@ -314,6 +326,61 @@ extern void xt_proto_fini(int af);
extern struct xt_table_info *xt_alloc_table_info(unsigned int size);
extern struct xt_table_info *xt_alloc_table_info(unsigned int size);
extern void xt_free_table_info(struct xt_table_info *info);
extern void xt_free_table_info(struct xt_table_info *info);


#ifdef CONFIG_COMPAT
#include <net/compat.h>

struct compat_xt_entry_match
{
	union {
		struct {
			u_int16_t match_size;
			char name[XT_FUNCTION_MAXNAMELEN - 1];
			u_int8_t revision;
		} user;
		u_int16_t match_size;
	} u;
	unsigned char data[0];
};

struct compat_xt_entry_target
{
	union {
		struct {
			u_int16_t target_size;
			char name[XT_FUNCTION_MAXNAMELEN - 1];
			u_int8_t revision;
		} user;
		u_int16_t target_size;
	} u;
	unsigned char data[0];
};

/* FIXME: this works only on 32 bit tasks
 * need to change whole approach in order to calculate align as function of
 * current task alignment */

struct compat_xt_counters
{
	u_int32_t cnt[4];
};

struct compat_xt_counters_info
{
	char name[XT_TABLE_MAXNAMELEN];
	compat_uint_t num_counters;
	struct compat_xt_counters counters[0];
};

#define COMPAT_XT_ALIGN(s) (((s) + (__alignof__(struct compat_xt_counters)-1)) \
		& ~(__alignof__(struct compat_xt_counters)-1))

extern void xt_compat_lock(int af);
extern void xt_compat_unlock(int af);
extern int xt_compat_match(void *match, void **dstptr, int *size, int convert);
extern int xt_compat_target(void *target, void **dstptr, int *size,
		int convert);

#endif /* CONFIG_COMPAT */
#endif /* __KERNEL__ */
#endif /* __KERNEL__ */


#endif /* _X_TABLES_H */
#endif /* _X_TABLES_H */
+14 −0
Original line number Original line Diff line number Diff line
#ifndef _XT_ESP_H
#define _XT_ESP_H

struct xt_esp
{
	u_int32_t spis[2];	/* Security Parameter Index */
	u_int8_t  invflags;	/* Inverse flags */
};

/* Values for "invflags" field in struct xt_esp. */
#define XT_ESP_INV_SPI	0x01	/* Invert the sense of spi. */
#define XT_ESP_INV_MASK	0x01	/* All possible flags. */

#endif /*_XT_ESP_H*/
+30 −0
Original line number Original line Diff line number Diff line
#ifndef _XT_MULTIPORT_H
#define _XT_MULTIPORT_H

enum xt_multiport_flags
{
	XT_MULTIPORT_SOURCE,
	XT_MULTIPORT_DESTINATION,
	XT_MULTIPORT_EITHER
};

#define XT_MULTI_PORTS	15

/* Must fit inside union xt_matchinfo: 16 bytes */
struct xt_multiport
{
	u_int8_t flags;				/* Type of comparison */
	u_int8_t count;				/* Number of ports */
	u_int16_t ports[XT_MULTI_PORTS];	/* Ports */
};

struct xt_multiport_v1
{
	u_int8_t flags;				/* Type of comparison */
	u_int8_t count;				/* Number of ports */
	u_int16_t ports[XT_MULTI_PORTS];	/* Ports */
	u_int8_t pflags[XT_MULTI_PORTS];	/* Port flags */
	u_int8_t invert;			/* Invert flag */
};

#endif /*_XT_MULTIPORT_H*/
Loading