Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6:
  bnx2: Fix the behavior of ethtool when ONBOOT=no
  qla3xxx: Don't sleep while holding lock.
  qla3xxx: Give the PHY time to come out of reset.
  ipv4 routing: Ensure that route cache entries are usable and reclaimable with caching is off
  net: Move rx skb_orphan call to where needed
  ipv6: Use correct data types for ICMPv6 type and code
  net: let KS8842 driver depend on HAS_IOMEM
  can: let SJA1000 driver depend on HAS_IOMEM
  netxen: fix firmware init handshake
  netxen: fix build with without CONFIG_PM
  netfilter: xt_rateest: fix comparison with self
  netfilter: xt_quota: fix incomplete initialization
  netfilter: nf_log: fix direct userspace memory access in proc handler
  netfilter: fix some sparse endianess warnings
  netfilter: nf_conntrack: fix conntrack lookup race
  netfilter: nf_conntrack: fix confirmation race condition
  netfilter: nf_conntrack: death_by_timeout() fix
  • Loading branch information
Linus Torvalds committed Jun 24, 2009
2 parents d7ed9c0 + 7959ea2 commit 09ce42d
Show file tree
Hide file tree
Showing 39 changed files with 149 additions and 88 deletions.
1 change: 1 addition & 0 deletions drivers/net/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1725,6 +1725,7 @@ config TLAN

config KS8842
tristate "Micrel KSZ8842"
depends on HAS_IOMEM
help
This platform driver is for Micrel KSZ8842 chip.

Expand Down
10 changes: 9 additions & 1 deletion drivers/net/bnx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -6825,6 +6825,14 @@ bnx2_nway_reset(struct net_device *dev)
return 0;
}

static u32
bnx2_get_link(struct net_device *dev)
{
struct bnx2 *bp = netdev_priv(dev);

return bp->link_up;
}

static int
bnx2_get_eeprom_len(struct net_device *dev)
{
Expand Down Expand Up @@ -7392,7 +7400,7 @@ static const struct ethtool_ops bnx2_ethtool_ops = {
.get_wol = bnx2_get_wol,
.set_wol = bnx2_set_wol,
.nway_reset = bnx2_nway_reset,
.get_link = ethtool_op_get_link,
.get_link = bnx2_get_link,
.get_eeprom_len = bnx2_get_eeprom_len,
.get_eeprom = bnx2_get_eeprom,
.set_eeprom = bnx2_set_eeprom,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/can/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ config CAN_CALC_BITTIMING
If unsure, say Y.

config CAN_SJA1000
depends on CAN_DEV
depends on CAN_DEV && HAS_IOMEM
tristate "Philips SJA1000"
---help---
Driver for the SJA1000 CAN controllers from Philips or NXP
Expand Down
37 changes: 20 additions & 17 deletions drivers/net/netxen/netxen_nic_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -944,28 +944,31 @@ int netxen_phantom_init(struct netxen_adapter *adapter, int pegtune_val)
u32 val = 0;
int retries = 60;

if (!pegtune_val) {
do {
val = NXRD32(adapter, CRB_CMDPEG_STATE);
if (pegtune_val)
return 0;

if (val == PHAN_INITIALIZE_COMPLETE ||
val == PHAN_INITIALIZE_ACK)
return 0;
do {
val = NXRD32(adapter, CRB_CMDPEG_STATE);

msleep(500);
switch (val) {
case PHAN_INITIALIZE_COMPLETE:
case PHAN_INITIALIZE_ACK:
return 0;
case PHAN_INITIALIZE_FAILED:
goto out_err;
default:
break;
}

} while (--retries);
msleep(500);

if (!retries) {
pegtune_val = NXRD32(adapter,
NETXEN_ROMUSB_GLB_PEGTUNE_DONE);
printk(KERN_WARNING "netxen_phantom_init: init failed, "
"pegtune_val=%x\n", pegtune_val);
return -1;
}
}
} while (--retries);

return 0;
NXWR32(adapter, CRB_CMDPEG_STATE, PHAN_INITIALIZE_FAILED);

out_err:
dev_warn(&adapter->pdev->dev, "firmware init failed\n");
return -EIO;
}

static int
Expand Down
7 changes: 6 additions & 1 deletion drivers/net/netxen/netxen_nic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ netxen_start_firmware(struct netxen_adapter *adapter, int request_fw)
first_driver = (adapter->ahw.pci_func == 0);

if (!first_driver)
return 0;
goto wait_init;

first_boot = NXRD32(adapter, NETXEN_CAM_RAM(0x1fc));

Expand Down Expand Up @@ -752,6 +752,7 @@ netxen_start_firmware(struct netxen_adapter *adapter, int request_fw)
| (_NETXEN_NIC_LINUX_SUBVERSION);
NXWR32(adapter, CRB_DRIVER_VERSION, val);

wait_init:
/* Handshake with the card before we register the devices. */
err = netxen_phantom_init(adapter, NETXEN_NIC_PEG_TUNE);
if (err) {
Expand Down Expand Up @@ -1178,6 +1179,7 @@ static void __devexit netxen_nic_remove(struct pci_dev *pdev)
free_netdev(netdev);
}

#ifdef CONFIG_PM
static int
netxen_nic_suspend(struct pci_dev *pdev, pm_message_t state)
{
Expand Down Expand Up @@ -1242,6 +1244,7 @@ netxen_nic_resume(struct pci_dev *pdev)

return 0;
}
#endif

static int netxen_nic_open(struct net_device *netdev)
{
Expand Down Expand Up @@ -1771,8 +1774,10 @@ static struct pci_driver netxen_driver = {
.id_table = netxen_pci_tbl,
.probe = netxen_nic_probe,
.remove = __devexit_p(netxen_nic_remove),
#ifdef CONFIG_PM
.suspend = netxen_nic_suspend,
.resume = netxen_nic_resume
#endif
};

/* Driver Registration on NetXen card */
Expand Down
6 changes: 5 additions & 1 deletion drivers/net/qla3xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -3142,6 +3142,7 @@ static int ql_adapter_initialize(struct ql3_adapter *qdev)
(void __iomem *)port_regs;
u32 delay = 10;
int status = 0;
unsigned long hw_flags = 0;

if(ql_mii_setup(qdev))
return -1;
Expand All @@ -3150,7 +3151,8 @@ static int ql_adapter_initialize(struct ql3_adapter *qdev)
ql_write_common_reg(qdev, &port_regs->CommonRegs.serialPortInterfaceReg,
(ISP_SERIAL_PORT_IF_WE |
(ISP_SERIAL_PORT_IF_WE << 16)));

/* Give the PHY time to come out of reset. */
mdelay(100);
qdev->port_link_state = LS_DOWN;
netif_carrier_off(qdev->ndev);

Expand Down Expand Up @@ -3350,7 +3352,9 @@ static int ql_adapter_initialize(struct ql3_adapter *qdev)
value = ql_read_page0_reg(qdev, &port_regs->portStatus);
if (value & PORT_STATUS_IC)
break;
spin_unlock_irqrestore(&qdev->hw_lock, hw_flags);
msleep(500);
spin_lock_irqsave(&qdev->hw_lock, hw_flags);
} while (--delay);

if (delay == 0) {
Expand Down
6 changes: 3 additions & 3 deletions include/linux/icmpv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,16 +175,16 @@ struct icmp6_filter {


extern void icmpv6_send(struct sk_buff *skb,
int type, int code,
u8 type, u8 code,
__u32 info,
struct net_device *dev);

extern int icmpv6_init(void);
extern int icmpv6_err_convert(int type, int code,
extern int icmpv6_err_convert(u8 type, u8 code,
int *err);
extern void icmpv6_cleanup(void);
extern void icmpv6_param_prob(struct sk_buff *skb,
int code, int pos);
u8 code, int pos);

struct flowi;
struct in6_addr;
Expand Down
2 changes: 1 addition & 1 deletion include/net/protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ struct inet6_protocol

void (*err_handler)(struct sk_buff *skb,
struct inet6_skb_parm *opt,
int type, int code, int offset,
u8 type, u8 code, int offset,
__be32 info);

int (*gso_send_check)(struct sk_buff *skb);
Expand Down
2 changes: 1 addition & 1 deletion include/net/rawv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <net/protocol.h>

void raw6_icmp_error(struct sk_buff *, int nexthdr,
int type, int code, int inner_offset, __be32);
u8 type, u8 code, int inner_offset, __be32);
int raw6_local_deliver(struct sk_buff *, int);

extern int rawv6_rcv(struct sock *sk,
Expand Down
1 change: 1 addition & 0 deletions include/net/sctp/sctp.h
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ static inline void sctp_skb_set_owner_r(struct sk_buff *skb, struct sock *sk)
{
struct sctp_ulpevent *event = sctp_skb2event(skb);

skb_orphan(skb);
skb->sk = sk;
skb->destructor = sctp_sock_rfree;
atomic_add(event->rmem_len, &sk->sk_rmem_alloc);
Expand Down
2 changes: 2 additions & 0 deletions include/net/sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -1252,6 +1252,7 @@ static inline int sk_has_allocations(const struct sock *sk)

static inline void skb_set_owner_w(struct sk_buff *skb, struct sock *sk)
{
skb_orphan(skb);
skb->sk = sk;
skb->destructor = sock_wfree;
/*
Expand All @@ -1264,6 +1265,7 @@ static inline void skb_set_owner_w(struct sk_buff *skb, struct sock *sk)

static inline void skb_set_owner_r(struct sk_buff *skb, struct sock *sk)
{
skb_orphan(skb);
skb->sk = sk;
skb->destructor = sock_rfree;
atomic_add(skb->truesize, &sk->sk_rmem_alloc);
Expand Down
2 changes: 1 addition & 1 deletion include/net/xfrm.h
Original file line number Diff line number Diff line change
Expand Up @@ -1274,7 +1274,7 @@ struct xfrm_tunnel {
struct xfrm6_tunnel {
int (*handler)(struct sk_buff *skb);
int (*err_handler)(struct sk_buff *skb, struct inet6_skb_parm *opt,
int type, int code, int offset, __be32 info);
u8 type, u8 code, int offset, __be32 info);
struct xfrm6_tunnel *next;
int priority;
};
Expand Down
3 changes: 1 addition & 2 deletions net/ax25/ax25_in.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,7 @@ static int ax25_rcv(struct sk_buff *skb, struct net_device *dev,
int ax25_kiss_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *ptype, struct net_device *orig_dev)
{
skb->sk = NULL; /* Initially we don't know who it's for */
skb->destructor = NULL; /* Who initializes this, dammit?! */
skb_orphan(skb);

if (!net_eq(dev_net(dev), &init_net)) {
kfree_skb(skb);
Expand Down
2 changes: 0 additions & 2 deletions net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -2310,8 +2310,6 @@ int netif_receive_skb(struct sk_buff *skb)
if (!skb)
goto out;

skb_orphan(skb);

type = skb->protocol;
list_for_each_entry_rcu(ptype,
&ptype_base[ntohs(type) & PTYPE_HASH_MASK], list) {
Expand Down
2 changes: 1 addition & 1 deletion net/dccp/ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static inline __u32 dccp_v6_init_sequence(struct sk_buff *skb)
}

static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
int type, int code, int offset, __be32 info)
u8 type, u8 code, int offset, __be32 info)
{
struct ipv6hdr *hdr = (struct ipv6hdr *)skb->data;
const struct dccp_hdr *dh = (struct dccp_hdr *)(skb->data + offset);
Expand Down
26 changes: 23 additions & 3 deletions net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -1093,8 +1093,27 @@ static int rt_intern_hash(unsigned hash, struct rtable *rt,
* If we drop it here, the callers have no way to resolve routes
* when we're not caching. Instead, just point *rp at rt, so
* the caller gets a single use out of the route
* Note that we do rt_free on this new route entry, so that
* once its refcount hits zero, we are still able to reap it
* (Thanks Alexey)
* Note also the rt_free uses call_rcu. We don't actually
* need rcu protection here, this is just our path to get
* on the route gc list.
*/
goto report_and_exit;

if (rt->rt_type == RTN_UNICAST || rt->fl.iif == 0) {
int err = arp_bind_neighbour(&rt->u.dst);
if (err) {
if (net_ratelimit())
printk(KERN_WARNING
"Neighbour table failure & not caching routes.\n");
rt_drop(rt);
return err;
}
}

rt_free(rt);
goto skip_hashing;
}

rthp = &rt_hash_table[hash].chain;
Expand Down Expand Up @@ -1211,7 +1230,8 @@ static int rt_intern_hash(unsigned hash, struct rtable *rt,
#if RT_CACHE_DEBUG >= 2
if (rt->u.dst.rt_next) {
struct rtable *trt;
printk(KERN_DEBUG "rt_cache @%02x: %pI4", hash, &rt->rt_dst);
printk(KERN_DEBUG "rt_cache @%02x: %pI4",
hash, &rt->rt_dst);
for (trt = rt->u.dst.rt_next; trt; trt = trt->u.dst.rt_next)
printk(" . %pI4", &trt->rt_dst);
printk("\n");
Expand All @@ -1226,7 +1246,7 @@ static int rt_intern_hash(unsigned hash, struct rtable *rt,

spin_unlock_bh(rt_hash_lock_addr(hash));

report_and_exit:
skip_hashing:
if (rp)
*rp = rt;
else
Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/ah6.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ static int ah6_input(struct xfrm_state *x, struct sk_buff *skb)
}

static void ah6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
int type, int code, int offset, __be32 info)
u8 type, u8 code, int offset, __be32 info)
{
struct net *net = dev_net(skb->dev);
struct ipv6hdr *iph = (struct ipv6hdr*)skb->data;
Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/esp6.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ static u32 esp6_get_mtu(struct xfrm_state *x, int mtu)
}

static void esp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
int type, int code, int offset, __be32 info)
u8 type, u8 code, int offset, __be32 info)
{
struct net *net = dev_net(skb->dev);
struct ipv6hdr *iph = (struct ipv6hdr*)skb->data;
Expand Down
12 changes: 6 additions & 6 deletions net/ipv6/icmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ static __inline__ void icmpv6_xmit_unlock(struct sock *sk)
/*
* Slightly more convenient version of icmpv6_send.
*/
void icmpv6_param_prob(struct sk_buff *skb, int code, int pos)
void icmpv6_param_prob(struct sk_buff *skb, u8 code, int pos)
{
icmpv6_send(skb, ICMPV6_PARAMPROB, code, pos, skb->dev);
kfree_skb(skb);
Expand Down Expand Up @@ -161,7 +161,7 @@ static int is_ineligible(struct sk_buff *skb)
/*
* Check the ICMP output rate limit
*/
static inline int icmpv6_xrlim_allow(struct sock *sk, int type,
static inline int icmpv6_xrlim_allow(struct sock *sk, u8 type,
struct flowi *fl)
{
struct dst_entry *dst;
Expand Down Expand Up @@ -305,7 +305,7 @@ static inline void mip6_addr_swap(struct sk_buff *skb) {}
/*
* Send an ICMP message in response to a packet in error
*/
void icmpv6_send(struct sk_buff *skb, int type, int code, __u32 info,
void icmpv6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info,
struct net_device *dev)
{
struct net *net = dev_net(skb->dev);
Expand Down Expand Up @@ -590,7 +590,7 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
icmpv6_xmit_unlock(sk);
}

static void icmpv6_notify(struct sk_buff *skb, int type, int code, __be32 info)
static void icmpv6_notify(struct sk_buff *skb, u8 type, u8 code, __be32 info)
{
struct inet6_protocol *ipprot;
int inner_offset;
Expand Down Expand Up @@ -643,7 +643,7 @@ static int icmpv6_rcv(struct sk_buff *skb)
struct in6_addr *saddr, *daddr;
struct ipv6hdr *orig_hdr;
struct icmp6hdr *hdr;
int type;
u8 type;

if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) {
struct sec_path *sp = skb_sec_path(skb);
Expand Down Expand Up @@ -914,7 +914,7 @@ static const struct icmp6_err {
},
};

int icmpv6_err_convert(int type, int code, int *err)
int icmpv6_err_convert(u8 type, u8 code, int *err)
{
int fatal = 0;

Expand Down
Loading

0 comments on commit 09ce42d

Please sign in to comment.