git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git]
/
drivers
/
net
/
wan
/
hdlc_cisco.c
diff --git
a/drivers/net/wan/hdlc_cisco.c
b/drivers/net/wan/hdlc_cisco.c
index
43e8bf3
..
c1b6896
100644
(file)
--- a/
drivers/net/wan/hdlc_cisco.c
+++ b/
drivers/net/wan/hdlc_cisco.c
@@
-180,7
+180,8
@@
static int cisco_rx(struct sk_buff *skb)
case CISCO_KEEPALIVE_REQ:
hdlc->state.cisco.rxseq = ntohl(cisco_data->par1);
case CISCO_KEEPALIVE_REQ:
hdlc->state.cisco.rxseq = ntohl(cisco_data->par1);
- if (ntohl(cisco_data->par2)==hdlc->state.cisco.txseq) {
+ if (hdlc->state.cisco.request_sent &&
+ ntohl(cisco_data->par2)==hdlc->state.cisco.txseq) {
hdlc->state.cisco.last_poll = jiffies;
if (!hdlc->state.cisco.up) {
u32 sec, min, hrs, days;
hdlc->state.cisco.last_poll = jiffies;
if (!hdlc->state.cisco.up) {
u32 sec, min, hrs, days;
@@
-192,8
+193,9
@@
static int cisco_rx(struct sk_buff *skb)
"uptime %ud%uh%um%us)\n",
dev->name, days, hrs,
min, sec);
"uptime %ud%uh%um%us)\n",
dev->name, days, hrs,
min, sec);
+ netif_carrier_on(dev);
+ hdlc->state.cisco.up = 1;
}
}
- hdlc->state.cisco.up = 1;
}
dev_kfree_skb_any(skb);
}
dev_kfree_skb_any(skb);
@@
-219,17
+221,18
@@
static void cisco_timer(unsigned long arg)
struct net_device *dev = (struct net_device *)arg;
hdlc_device *hdlc = dev_to_hdlc(dev);
struct net_device *dev = (struct net_device *)arg;
hdlc_device *hdlc = dev_to_hdlc(dev);
- if (hdlc->state.cisco.up && jiffies - hdlc->state.cisco.last_poll >=
- hdlc->state.cisco.settings.timeout * HZ) {
+ if (hdlc->state.cisco.up &&
+ time_after(jiffies, hdlc->state.cisco.last_poll +
+ hdlc->state.cisco.settings.timeout * HZ)) {
hdlc->state.cisco.up = 0;
printk(KERN_INFO "%s: Link down\n", dev->name);
hdlc->state.cisco.up = 0;
printk(KERN_INFO "%s: Link down\n", dev->name);
- if (netif_carrier_ok(dev))
- netif_carrier_off(dev);
+ netif_carrier_off(dev);
}
cisco_keepalive_send(dev, CISCO_KEEPALIVE_REQ,
++hdlc->state.cisco.txseq,
hdlc->state.cisco.rxseq);
}
cisco_keepalive_send(dev, CISCO_KEEPALIVE_REQ,
++hdlc->state.cisco.txseq,
hdlc->state.cisco.rxseq);
+ hdlc->state.cisco.request_sent = 1;
hdlc->state.cisco.timer.expires = jiffies +
hdlc->state.cisco.settings.interval * HZ;
hdlc->state.cisco.timer.function = cisco_timer;
hdlc->state.cisco.timer.expires = jiffies +
hdlc->state.cisco.settings.interval * HZ;
hdlc->state.cisco.timer.function = cisco_timer;
@@
-242,8
+245,8
@@
static void cisco_timer(unsigned long arg)
static void cisco_start(struct net_device *dev)
{
hdlc_device *hdlc = dev_to_hdlc(dev);
static void cisco_start(struct net_device *dev)
{
hdlc_device *hdlc = dev_to_hdlc(dev);
- hdlc->state.cisco.last_poll = 0;
hdlc->state.cisco.up = 0;
hdlc->state.cisco.up = 0;
+ hdlc->state.cisco.request_sent = 0;
hdlc->state.cisco.txseq = hdlc->state.cisco.rxseq = 0;
init_timer(&hdlc->state.cisco.timer);
hdlc->state.cisco.txseq = hdlc->state.cisco.rxseq = 0;
init_timer(&hdlc->state.cisco.timer);
@@
-257,16
+260,19
@@
static void cisco_start(struct net_device *dev)
static void cisco_stop(struct net_device *dev)
{
static void cisco_stop(struct net_device *dev)
{
- del_timer_sync(&dev_to_hdlc(dev)->state.cisco.timer);
+ hdlc_device *hdlc = dev_to_hdlc(dev);
+ del_timer_sync(&hdlc->state.cisco.timer);
if (netif_carrier_ok(dev))
netif_carrier_off(dev);
if (netif_carrier_ok(dev))
netif_carrier_off(dev);
+ hdlc->state.cisco.up = 0;
+ hdlc->state.cisco.request_sent = 0;
}
int hdlc_cisco_ioctl(struct net_device *dev, struct ifreq *ifr)
{
}
int hdlc_cisco_ioctl(struct net_device *dev, struct ifreq *ifr)
{
- cisco_proto *cisco_s = ifr->ifr_settings.ifs_ifsu.cisco;
+ cisco_proto
__user
*cisco_s = ifr->ifr_settings.ifs_ifsu.cisco;
const size_t size = sizeof(cisco_proto);
cisco_proto new_settings;
hdlc_device *hdlc = dev_to_hdlc(dev);
const size_t size = sizeof(cisco_proto);
cisco_proto new_settings;
hdlc_device *hdlc = dev_to_hdlc(dev);