diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-10-15 18:03:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-10-15 18:03:17 -0400 |
commit | c3da31485f074a6f598b67045b08e2e15d908310 (patch) | |
tree | 64f9ad3d3752e80de2b22b47cbea8f8512dc5d59 /drivers/net/wan | |
parent | bd0704111e625ebe75418531550cf471215c3267 (diff) | |
parent | 8f7e524ce33ca81b663711404709396165da3cbd (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (53 commits)
vmxnet: fix 2 build problems
net: add support for STMicroelectronics Ethernet controllers.
net: ks8851_mll uses mii interfaces
net/fec_mpc52xx: Fix kernel panic on FEC error
net: Fix OF platform drivers coldplug/hotplug when compiled as modules
TI DaVinci EMAC: Clear statistics register properly.
r8169: partial support and phy init for the 8168d
irda/sa1100_ir: check return value of startup hook
udp: Fix udp_poll() and ioctl()
WAN: fix Cisco HDLC handshaking.
tcp: fix tcp_defer_accept to consider the timeout
3c574_cs: spin_lock the set_multicast_list function
net: Teach pegasus driver to ignore bluetoother adapters with clashing Vendor:Product IDs
netxen: fix pci bar mapping
ethoc: fix warning from 32bit build
libertas: fix build
net: VMware virtual Ethernet NIC driver: vmxnet3
net: Fix IXP 2000 network driver building.
libertas: fix build
mac80211: document ieee80211_rx() context requirement
...
Diffstat (limited to 'drivers/net/wan')
-rw-r--r-- | drivers/net/wan/hdlc_cisco.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/net/wan/hdlc_cisco.c b/drivers/net/wan/hdlc_cisco.c index cf5fd17ad707..f1bff98acd1f 100644 --- a/drivers/net/wan/hdlc_cisco.c +++ b/drivers/net/wan/hdlc_cisco.c | |||
@@ -58,8 +58,7 @@ struct cisco_state { | |||
58 | spinlock_t lock; | 58 | spinlock_t lock; |
59 | unsigned long last_poll; | 59 | unsigned long last_poll; |
60 | int up; | 60 | int up; |
61 | int request_sent; | 61 | u32 txseq; /* TX sequence number, 0 = none */ |
62 | u32 txseq; /* TX sequence number */ | ||
63 | u32 rxseq; /* RX sequence number */ | 62 | u32 rxseq; /* RX sequence number */ |
64 | }; | 63 | }; |
65 | 64 | ||
@@ -163,6 +162,7 @@ static int cisco_rx(struct sk_buff *skb) | |||
163 | struct cisco_packet *cisco_data; | 162 | struct cisco_packet *cisco_data; |
164 | struct in_device *in_dev; | 163 | struct in_device *in_dev; |
165 | __be32 addr, mask; | 164 | __be32 addr, mask; |
165 | u32 ack; | ||
166 | 166 | ||
167 | if (skb->len < sizeof(struct hdlc_header)) | 167 | if (skb->len < sizeof(struct hdlc_header)) |
168 | goto rx_error; | 168 | goto rx_error; |
@@ -223,8 +223,10 @@ static int cisco_rx(struct sk_buff *skb) | |||
223 | case CISCO_KEEPALIVE_REQ: | 223 | case CISCO_KEEPALIVE_REQ: |
224 | spin_lock(&st->lock); | 224 | spin_lock(&st->lock); |
225 | st->rxseq = ntohl(cisco_data->par1); | 225 | st->rxseq = ntohl(cisco_data->par1); |
226 | if (st->request_sent && | 226 | ack = ntohl(cisco_data->par2); |
227 | ntohl(cisco_data->par2) == st->txseq) { | 227 | if (ack && (ack == st->txseq || |
228 | /* our current REQ may be in transit */ | ||
229 | ack == st->txseq - 1)) { | ||
228 | st->last_poll = jiffies; | 230 | st->last_poll = jiffies; |
229 | if (!st->up) { | 231 | if (!st->up) { |
230 | u32 sec, min, hrs, days; | 232 | u32 sec, min, hrs, days; |
@@ -275,7 +277,6 @@ static void cisco_timer(unsigned long arg) | |||
275 | 277 | ||
276 | cisco_keepalive_send(dev, CISCO_KEEPALIVE_REQ, htonl(++st->txseq), | 278 | cisco_keepalive_send(dev, CISCO_KEEPALIVE_REQ, htonl(++st->txseq), |
277 | htonl(st->rxseq)); | 279 | htonl(st->rxseq)); |
278 | st->request_sent = 1; | ||
279 | spin_unlock(&st->lock); | 280 | spin_unlock(&st->lock); |
280 | 281 | ||
281 | st->timer.expires = jiffies + st->settings.interval * HZ; | 282 | st->timer.expires = jiffies + st->settings.interval * HZ; |
@@ -293,9 +294,7 @@ static void cisco_start(struct net_device *dev) | |||
293 | unsigned long flags; | 294 | unsigned long flags; |
294 | 295 | ||
295 | spin_lock_irqsave(&st->lock, flags); | 296 | spin_lock_irqsave(&st->lock, flags); |
296 | st->up = 0; | 297 | st->up = st->txseq = st->rxseq = 0; |
297 | st->request_sent = 0; | ||
298 | st->txseq = st->rxseq = 0; | ||
299 | spin_unlock_irqrestore(&st->lock, flags); | 298 | spin_unlock_irqrestore(&st->lock, flags); |
300 | 299 | ||
301 | init_timer(&st->timer); | 300 | init_timer(&st->timer); |
@@ -317,8 +316,7 @@ static void cisco_stop(struct net_device *dev) | |||
317 | 316 | ||
318 | spin_lock_irqsave(&st->lock, flags); | 317 | spin_lock_irqsave(&st->lock, flags); |
319 | netif_dormant_on(dev); | 318 | netif_dormant_on(dev); |
320 | st->up = 0; | 319 | st->up = st->txseq = 0; |
321 | st->request_sent = 0; | ||
322 | spin_unlock_irqrestore(&st->lock, flags); | 320 | spin_unlock_irqrestore(&st->lock, flags); |
323 | } | 321 | } |
324 | 322 | ||