diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2015-07-25 01:55:22 +0200 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2015-08-28 15:47:56 +0200 |
commit | 28984c8584d2c96a9beb2dcebef2985bc041ca7b (patch) | |
tree | b5e34f04b5cbf12695b65ce191068c245147a73f /device/if_hdr.h | |
parent | 36eebd1268c58058998e92fc58c80346f3783ed7 (diff) |
device: use general lock for port lists
* device/if_hdr.h (struct ifnet): Turn the port list locks into
general locks.
(port_list_{lock_init,lock,unlock): New macros.
* device/net_io.c (net_filter, net_set_filter): Use new macros.
* device/subrs.c (if_init_queues): Likewise.
Diffstat (limited to 'device/if_hdr.h')
-rw-r--r-- | device/if_hdr.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/device/if_hdr.h b/device/if_hdr.h index e53983b..58a670c 100644 --- a/device/if_hdr.h +++ b/device/if_hdr.h @@ -92,11 +92,13 @@ struct ifnet { struct ifqueue if_snd; /* output queue */ queue_head_t if_rcv_port_list; /* input filter list */ queue_head_t if_snd_port_list; /* output filter list */ - decl_simple_lock_data(, - if_rcv_port_list_lock) /* lock for input filter list */ - decl_simple_lock_data(, - if_snd_port_list_lock) /* lock for output filter list */ -/* statistics */ + struct lock if_rcv_port_list_lock; /* lock for input filter list */ + struct lock if_snd_port_list_lock; /* lock for output filter list */ +#define port_list_lock_init(l) lock_init(l, FALSE) +#define port_list_lock(l) lock_write(l) +#define port_list_unlock(l) lock_write_done(l) + + /* statistics */ int if_ipackets; /* packets received */ int if_ierrors; /* input errors */ int if_opackets; /* packets sent */ |