Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 22323
b: refs/heads/master
c: 18fdb2b
h: refs/heads/master
i:
  22321: 1f578ae
  22319: bbe6d7c
v: v3
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Mar 21, 2006
1 parent fc626cc commit ba901b6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 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: f8ae737deea1be001d7d8ac11c382a7b73a1c98f
refs/heads/master: 18fdb2b25be37e49b1669b5c394671f8c5b6550f
17 changes: 8 additions & 9 deletions trunk/net/bridge/br_stp_bpdu.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
#include "br_private.h"
#include "br_private_stp.h"

#define JIFFIES_TO_TICKS(j) (((j) << 8) / HZ)
#define TICKS_TO_JIFFIES(j) (((j) * HZ) >> 8)
#define STP_HZ 256

static void br_send_bpdu(struct net_bridge_port *p, unsigned char *data, int length)
{
Expand Down Expand Up @@ -57,18 +56,18 @@ static void br_send_bpdu(struct net_bridge_port *p, unsigned char *data, int len
dev_queue_xmit);
}

static __inline__ void br_set_ticks(unsigned char *dest, int jiff)
static inline void br_set_ticks(unsigned char *dest, int j)
{
__u16 ticks;
unsigned long ticks = (STP_HZ * j)/ HZ;

ticks = JIFFIES_TO_TICKS(jiff);
dest[0] = (ticks >> 8) & 0xFF;
dest[1] = ticks & 0xFF;
*((__be16 *) dest) = htons(ticks);
}

static __inline__ int br_get_ticks(unsigned char *dest)
static inline int br_get_ticks(const unsigned char *src)
{
return TICKS_TO_JIFFIES((dest[0] << 8) | dest[1]);
unsigned long ticks = ntohs(*(__be16 *)src);

return (ticks * HZ + STP_HZ - 1) / STP_HZ;
}

/* called under bridge lock */
Expand Down

0 comments on commit ba901b6

Please sign in to comment.