[PATCH] x86-64: Don't include config.h in asm/timex.h
[pandora-kernel.git] / net / 802 / tr.c
index 3bfb862..1bb7dc1 100644 (file)
@@ -47,12 +47,12 @@ static void rif_check_expire(unsigned long dummy);
  *     Each RIF entry we learn is kept this way
  */
  
-struct rif_cache_s {   
+struct rif_cache {
        unsigned char addr[TR_ALEN];
        int iface;
        __be16 rcf;
        __be16 rseg[8];
-       struct rif_cache_s *next;
+       struct rif_cache *next;
        unsigned long last_used;
        unsigned char local_ring;
 };
@@ -64,7 +64,7 @@ struct rif_cache_s {
  *     up a lot.
  */
  
-static struct rif_cache_s *rif_table[RIF_TABLE_SIZE];
+static struct rif_cache *rif_table[RIF_TABLE_SIZE];
 
 static DEFINE_SPINLOCK(rif_lock);
 
@@ -249,12 +249,13 @@ void tr_source_route(struct sk_buff *skb,struct trh_hdr *trh,struct net_device *
 {
        int slack;
        unsigned int hash;
-       struct rif_cache_s *entry;
+       struct rif_cache *entry;
        unsigned char *olddata;
+       unsigned long flags;
        static const unsigned char mcast_func_addr[] 
                = {0xC0,0x00,0x00,0x04,0x00,0x00};
        
-       spin_lock_bh(&rif_lock);
+       spin_lock_irqsave(&rif_lock, flags);
 
        /*
         *      Broadcasts are single route as stated in RFC 1042 
@@ -323,7 +324,7 @@ printk("source routing for %02X:%02X:%02X:%02X:%02X:%02X\n",trh->daddr[0],
        else 
                slack = 18 - ((ntohs(trh->rcf) & TR_RCF_LEN_MASK)>>8);
        olddata = skb->data;
-       spin_unlock_bh(&rif_lock);
+       spin_unlock_irqrestore(&rif_lock, flags);
 
        skb_pull(skb, slack);
        memmove(skb->data, olddata, sizeof(struct trh_hdr) - slack);
@@ -337,10 +338,11 @@ printk("source routing for %02X:%02X:%02X:%02X:%02X:%02X\n",trh->daddr[0],
 static void tr_add_rif_info(struct trh_hdr *trh, struct net_device *dev)
 {
        unsigned int hash, rii_p = 0;
-       struct rif_cache_s *entry;
+       unsigned long flags;
+       struct rif_cache *entry;
 
 
-       spin_lock_bh(&rif_lock);
+       spin_lock_irqsave(&rif_lock, flags);
        
        /*
         *      Firstly see if the entry exists
@@ -373,12 +375,12 @@ printk("adding rif_entry: addr:%02X:%02X:%02X:%02X:%02X:%02X rcf:%04X\n",
                 *      FIXME: We ought to keep some kind of cache size
                 *      limiting and adjust the timers to suit.
                 */
-               entry=kmalloc(sizeof(struct rif_cache_s),GFP_ATOMIC);
+               entry=kmalloc(sizeof(struct rif_cache),GFP_ATOMIC);
 
                if(!entry) 
                {
                        printk(KERN_DEBUG "tr.c: Couldn't malloc rif cache entry !\n");
-                       spin_unlock_bh(&rif_lock);
+                       spin_unlock_irqrestore(&rif_lock, flags);
                        return;
                }
 
@@ -420,7 +422,7 @@ printk("updating rif_entry: addr:%02X:%02X:%02X:%02X:%02X:%02X rcf:%04X\n",
                    }                                         
                entry->last_used=jiffies;               
        }
-       spin_unlock_bh(&rif_lock);
+       spin_unlock_irqrestore(&rif_lock, flags);
 }
 
 /*
@@ -430,12 +432,12 @@ printk("updating rif_entry: addr:%02X:%02X:%02X:%02X:%02X:%02X rcf:%04X\n",
 static void rif_check_expire(unsigned long dummy) 
 {
        int i;
-       unsigned long next_interval = jiffies + sysctl_tr_rif_timeout/2;
+       unsigned long flags, next_interval = jiffies + sysctl_tr_rif_timeout/2;
 
-       spin_lock_bh(&rif_lock);
+       spin_lock_irqsave(&rif_lock, flags);
        
        for(i =0; i < RIF_TABLE_SIZE; i++) {
-               struct rif_cache_s *entry, **pentry;
+               struct rif_cache *entry, **pentry;
                
                pentry = rif_table+i;
                while((entry=*pentry) != NULL) {
@@ -454,7 +456,7 @@ static void rif_check_expire(unsigned long dummy)
                }
        }
        
-       spin_unlock_bh(&rif_lock);
+       spin_unlock_irqrestore(&rif_lock, flags);
 
        mod_timer(&rif_timer, next_interval);
 
@@ -467,10 +469,10 @@ static void rif_check_expire(unsigned long dummy)
  
 #ifdef CONFIG_PROC_FS
 
-static struct rif_cache_s *rif_get_idx(loff_t pos)
+static struct rif_cache *rif_get_idx(loff_t pos)
 {
        int i;
-       struct rif_cache_s *entry;
+       struct rif_cache *entry;
        loff_t off = 0;
 
        for(i = 0; i < RIF_TABLE_SIZE; i++) 
@@ -485,7 +487,7 @@ static struct rif_cache_s *rif_get_idx(loff_t pos)
 
 static void *rif_seq_start(struct seq_file *seq, loff_t *pos)
 {
-       spin_lock_bh(&rif_lock);
+       spin_lock_irq(&rif_lock);
 
        return *pos ? rif_get_idx(*pos - 1) : SEQ_START_TOKEN;
 }
@@ -493,7 +495,7 @@ static void *rif_seq_start(struct seq_file *seq, loff_t *pos)
 static void *rif_seq_next(struct seq_file *seq, void *v, loff_t *pos)
 {
        int i;
-       struct rif_cache_s *ent = v;
+       struct rif_cache *ent = v;
 
        ++*pos;
 
@@ -516,13 +518,13 @@ static void *rif_seq_next(struct seq_file *seq, void *v, loff_t *pos)
 
 static void rif_seq_stop(struct seq_file *seq, void *v)
 {
-       spin_unlock_bh(&rif_lock);
+       spin_unlock_irq(&rif_lock);
 }
 
 static int rif_seq_show(struct seq_file *seq, void *v)
 {
        int j, rcf_len, segment, brdgnmb;
-       struct rif_cache_s *entry = v;
+       struct rif_cache *entry = v;
 
        if (v == SEQ_START_TOKEN)
                seq_puts(seq,