summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_iwmvar.h
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2017-10-04 18:00:13 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2017-10-04 18:00:13 +0000
commit6af059abef33d2763ecfdae79a8d862ea1aef82b (patch)
treeeea987b57ed2234b82f092a88bb11e97973f8477 /sys/dev/pci/if_iwmvar.h
parent4158bdb22fe89a01e01ecea58172210886787a24 (diff)
Introduce reference counting for tasks in iwm(4).
When bringing the interface down, the driver now waits for any running tasks to complete before shutting down the hardware. Based on suggestions by dlg@ and mpi@ Tested by myself, Manuel Giraud, anton@, and jcs@
Diffstat (limited to 'sys/dev/pci/if_iwmvar.h')
-rw-r--r--sys/dev/pci/if_iwmvar.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/pci/if_iwmvar.h b/sys/dev/pci/if_iwmvar.h
index f6d16b853f7..a843fa491bc 100644
--- a/sys/dev/pci/if_iwmvar.h
+++ b/sys/dev/pci/if_iwmvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwmvar.h,v 1.34 2017/08/27 12:38:23 stsp Exp $ */
+/* $OpenBSD: if_iwmvar.h,v 1.35 2017/10/04 18:00:12 stsp Exp $ */
/*
* Copyright (c) 2014 genua mbh <info@genua.de>
@@ -287,6 +287,7 @@ struct iwm_rx_ring {
#define IWM_FLAG_STA_ACTIVE 0x20 /* AP added to firmware station table */
#define IWM_FLAG_TE_ACTIVE 0x40 /* time event is scheduled */
#define IWM_FLAG_HW_ERR 0x80 /* hardware error occurred */
+#define IWM_FLAG_SHUTDOWN 0x100 /* shutting down; new tasks forbidden */
struct iwm_ucode_status {
uint32_t uc_error_event_table;
@@ -358,7 +359,8 @@ struct iwm_softc {
struct timeout sc_calib_to;
struct timeout sc_led_blink_to;
- struct task init_task;
+ struct task init_task; /* NB: not reference-counted */
+ struct refcnt task_refs;
struct task newstate_task;
struct task setrates_task;
enum ieee80211_state ns_nstate;