~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/net/irda/irqueue.h

Version: ~ [ linux-5.1-rc1 ] ~ [ linux-5.0.3 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.30 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.107 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.164 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.176 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.136 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.63 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*********************************************************************
  2  *                
  3  * Filename:      irqueue.h
  4  * Version:       0.3
  5  * Description:   General queue implementation
  6  * Status:        Experimental.
  7  * Author:        Dag Brattli <dagb@cs.uit.no>
  8  * Created at:    Tue Jun  9 13:26:50 1998
  9  * Modified at:   Thu Oct  7 13:25:16 1999
 10  * Modified by:   Dag Brattli <dagb@cs.uit.no>
 11  * 
 12  *     Copyright (C) 1998-1999, Aage Kvalnes <aage@cs.uit.no>
 13  *     Copyright (c) 1998, Dag Brattli
 14  *     All Rights Reserved.
 15  *      
 16  *     This code is taken from the Vortex Operating System written by Aage
 17  *     Kvalnes and has been ported to Linux and Linux/IR by Dag Brattli
 18  *
 19  *     This program is free software; you can redistribute it and/or 
 20  *     modify it under the terms of the GNU General Public License as 
 21  *     published by the Free Software Foundation; either version 2 of 
 22  *     the License, or (at your option) any later version.
 23  *  
 24  *     Neither Dag Brattli nor University of Tromsų admit liability nor
 25  *     provide warranty for any of this software. This material is 
 26  *     provided "AS-IS" and at no charge.
 27  *     
 28  ********************************************************************/
 29 
 30 #include <linux/types.h>
 31 #include <linux/spinlock.h>
 32 
 33 #ifndef IRDA_QUEUE_H
 34 #define IRDA_QUEUE_H
 35 
 36 #define NAME_SIZE      32
 37 
 38 /*
 39  * Hash types (some flags can be xored)
 40  * See comments in irqueue.c for which one to use...
 41  */
 42 #define HB_NOLOCK       0       /* No concurent access prevention */
 43 #define HB_LOCK         1       /* Prevent concurent write with global lock */
 44 #define HB_SORTED       4       /* Not yet supported */
 45 
 46 /*
 47  * Hash defines
 48  */
 49 #define HASHBIN_SIZE   8
 50 #define HASHBIN_MASK   0x7
 51 
 52 #ifndef IRDA_ALIGN 
 53 #define IRDA_ALIGN __attribute__((aligned))
 54 #endif
 55 
 56 #define Q_NULL { NULL, NULL, "", 0 }
 57 
 58 typedef void (*FREE_FUNC)(void *arg);
 59 
 60 struct irda_queue {
 61         struct irda_queue *q_next;
 62         struct irda_queue *q_prev;
 63 
 64         char   q_name[NAME_SIZE];
 65         long   q_hash;                  /* Must be able to cast a (void *) */
 66 };
 67 typedef struct irda_queue irda_queue_t;
 68 
 69 typedef struct hashbin_t {
 70         __u32      magic;
 71         int        hb_type;
 72         int        hb_size;
 73         spinlock_t hb_spinlock;         /* HB_LOCK - Can be used by the user */
 74 
 75         irda_queue_t* hb_queue[HASHBIN_SIZE] IRDA_ALIGN;
 76 
 77         irda_queue_t* hb_current;
 78 } hashbin_t;
 79 
 80 hashbin_t *hashbin_new(int type);
 81 int      hashbin_delete(hashbin_t* hashbin, FREE_FUNC func);
 82 int      hashbin_clear(hashbin_t* hashbin, FREE_FUNC free_func);
 83 void     hashbin_insert(hashbin_t* hashbin, irda_queue_t* entry, long hashv, 
 84                         char* name);
 85 void*    hashbin_remove(hashbin_t* hashbin, long hashv, char* name);
 86 void*    hashbin_remove_first(hashbin_t *hashbin);
 87 void*    hashbin_remove_this( hashbin_t* hashbin, irda_queue_t* entry);
 88 void*    hashbin_find(hashbin_t* hashbin, long hashv, char* name);
 89 void*    hashbin_lock_find(hashbin_t* hashbin, long hashv, char* name);
 90 void*    hashbin_find_next(hashbin_t* hashbin, long hashv, char* name,
 91                            void ** pnext);
 92 irda_queue_t *hashbin_get_first(hashbin_t *hashbin);
 93 irda_queue_t *hashbin_get_next(hashbin_t *hashbin);
 94 
 95 #define HASHBIN_GET_SIZE(hashbin) hashbin->hb_size
 96 
 97 #endif
 98 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp