/* * Subject to the GPL, version 2. */ #include "xmalloc.h" struct panic_handler { void *arg; pid_t pid; bool is_enabled; void (*on_panic)(void *arg); struct panic_handler *next; }; static struct panic_handler *panic_handlers; void panic_handler_add(void (*on_panic)(void *arg), void *arg) { struct panic_handler *handler = xmallocz(sizeof(*handler)); handler->arg = arg; handler->pid = getpid(); handler->is_enabled = true; handler->on_panic = on_panic; handler->next = panic_handlers; panic_handlers = handler; }; void call_panic_handlers(void) { struct panic_handler *it; pid_t pid = getpid(); for (it = panic_handlers; it; it = it->next) { if (it->pid == pid && it->is_enabled) { it->is_enabled = false; it->on_panic(it->arg); } } } index : net-next.git
net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2016-08-28 13:10:37 +0200
committerJohannes Berg <johannes.berg@intel.com>2016-09-12 11:54:42 +0200
commit83843c80dcf11a78995d167255b03072a1e49c2c (patch)
treef9dfd841ddb98caeaf08fded9b89845d833c31c0
parent15543692a010192b4264ade0d45390e8bb3dc639 (diff)
mac80211: fix tim recalculation after PS response
Handle the case where the mac80211 intermediate queues are empty and the driver has buffered frames Fixes: ba8c3d6f16a1 ("mac80211: add an intermediate software queue implementation") Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat