Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 167541
b: refs/heads/master
c: 9652041
h: refs/heads/master
i:
  167539: 256c92d
v: v3
  • Loading branch information
Krzysztof Halasa authored and David S. Miller committed Oct 13, 2009
1 parent d2d0d14 commit a777b6d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6d01a026b7d3009a418326bdcf313503a314f1ea
refs/heads/master: 9652041da18a1a1d9a0b7ebd9eef16bd712be38a
18 changes: 8 additions & 10 deletions trunk/drivers/net/wan/hdlc_cisco.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ struct cisco_state {
spinlock_t lock;
unsigned long last_poll;
int up;
int request_sent;
u32 txseq; /* TX sequence number */
u32 txseq; /* TX sequence number, 0 = none */
u32 rxseq; /* RX sequence number */
};

Expand Down Expand Up @@ -163,6 +162,7 @@ static int cisco_rx(struct sk_buff *skb)
struct cisco_packet *cisco_data;
struct in_device *in_dev;
__be32 addr, mask;
u32 ack;

if (skb->len < sizeof(struct hdlc_header))
goto rx_error;
Expand Down Expand Up @@ -223,8 +223,10 @@ static int cisco_rx(struct sk_buff *skb)
case CISCO_KEEPALIVE_REQ:
spin_lock(&st->lock);
st->rxseq = ntohl(cisco_data->par1);
if (st->request_sent &&
ntohl(cisco_data->par2) == st->txseq) {
ack = ntohl(cisco_data->par2);
if (ack && (ack == st->txseq ||
/* our current REQ may be in transit */
ack == st->txseq - 1)) {
st->last_poll = jiffies;
if (!st->up) {
u32 sec, min, hrs, days;
Expand Down Expand Up @@ -275,7 +277,6 @@ static void cisco_timer(unsigned long arg)

cisco_keepalive_send(dev, CISCO_KEEPALIVE_REQ, htonl(++st->txseq),
htonl(st->rxseq));
st->request_sent = 1;
spin_unlock(&st->lock);

st->timer.expires = jiffies + st->settings.interval * HZ;
Expand All @@ -293,9 +294,7 @@ static void cisco_start(struct net_device *dev)
unsigned long flags;

spin_lock_irqsave(&st->lock, flags);
st->up = 0;
st->request_sent = 0;
st->txseq = st->rxseq = 0;
st->up = st->txseq = st->rxseq = 0;
spin_unlock_irqrestore(&st->lock, flags);

init_timer(&st->timer);
Expand All @@ -317,8 +316,7 @@ static void cisco_stop(struct net_device *dev)

spin_lock_irqsave(&st->lock, flags);
netif_dormant_on(dev);
st->up = 0;
st->request_sent = 0;
st->up = st->txseq = 0;
spin_unlock_irqrestore(&st->lock, flags);
}

Expand Down

0 comments on commit a777b6d

Please sign in to comment.