Skip to content

Commit 2cb0a33

Browse files
committed
- pull in without INVARIANTS code, from erikarn#35
1 parent 6c644e7 commit 2cb0a33

File tree

4 files changed

+45
-1
lines changed

4 files changed

+45
-1
lines changed

otus/freebsd/src/sys/dev/athp/if_athp_mac.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8954,7 +8954,9 @@ athp_vif_update_txpower(struct ieee80211vap *vap)
89548954
int
89558955
athp_vif_update_ap_ssid(struct ieee80211vap *vap, struct ieee80211_node *ni)
89568956
{
8957+
#ifdef INVARIANTS
89578958
struct ath10k *ar = vap->iv_ic->ic_softc;
8959+
#endif
89588960
struct ath10k_vif *arvif = ath10k_vif_to_arvif(vap);
89598961

89608962
ATHP_CONF_LOCK_ASSERT(ar);
@@ -9128,7 +9130,9 @@ athp_vif_ap_setup(struct ieee80211vap *vap, struct ieee80211_node *ni)
91289130
int
91299131
athp_vif_ap_stop(struct ieee80211vap *vap, struct ieee80211_node *ni)
91309132
{
9133+
#ifdef INVARIANTS
91319134
struct ath10k *ar = vap->iv_ic->ic_softc;
9135+
#endif
91329136
struct ath10k_vif *arvif = ath10k_vif_to_arvif(vap);
91339137

91349138
ATHP_CONF_LOCK_ASSERT(ar);

otus/freebsd/src/sys/dev/athp/if_athp_pci_ce.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,9 @@ ath10k_ce_send_nolock(struct ath10k_ce_pipe *ce_state,
425425
void __ath10k_ce_send_revert(struct ath10k_ce_pipe *pipe)
426426
{
427427
struct ath10k *ar = pipe->ar;
428+
#ifdef INVARIANTS
428429
struct ath10k_pci *ar_pci = pipe->psc;
430+
#endif
429431
struct ath10k_ce_ring *src_ring = pipe->src_ring;
430432
uint32_t ctrl_addr = pipe->ctrl_addr;
431433

@@ -486,7 +488,9 @@ int ath10k_ce_num_free_src_entries(struct ath10k_ce_pipe *pipe)
486488
int __ath10k_ce_rx_num_free_bufs(struct ath10k_ce_pipe *pipe)
487489
{
488490
// struct ath10k *ar = pipe->ar;
491+
#ifdef INVARIANTS
489492
struct ath10k_pci *ar_pci = pipe->psc;
493+
#endif
490494
struct ath10k_ce_ring *dest_ring = pipe->dest_ring;
491495
unsigned int nentries_mask = dest_ring->nentries_mask;
492496
unsigned int write_index = dest_ring->write_index;
@@ -500,7 +504,9 @@ int __ath10k_ce_rx_num_free_bufs(struct ath10k_ce_pipe *pipe)
500504
int __ath10k_ce_rx_post_buf(struct ath10k_ce_pipe *pipe, void *ctx, uint32_t paddr)
501505
{
502506
struct ath10k *ar = pipe->ar;
507+
#ifdef INVARIANTS
503508
struct ath10k_pci *ar_pci = pipe->psc;
509+
#endif
504510
struct ath10k_ce_ring *dest_ring = pipe->dest_ring;
505511
unsigned int nentries_mask = dest_ring->nentries_mask;
506512
unsigned int write_index = dest_ring->write_index;

otus/freebsd/src/sys/dev/athp/if_athp_pci_pipe.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ static int
123123
__ath10k_pci_rx_post_buf(struct ath10k_pci_pipe *pipe)
124124
{
125125
struct ath10k *ar = pipe->ar;
126+
#ifdef INVARIANTS
126127
struct ath10k_pci *ar_pci = pipe->psc;
128+
#endif
127129
struct ath10k_ce_pipe *ce_pipe = pipe->ce_hdl;
128130
struct athp_buf *pbuf;
129131
int ret;
@@ -173,7 +175,9 @@ static void
173175
__ath10k_pci_rx_post_pipe(struct ath10k_pci_pipe *pipe)
174176
{
175177
struct ath10k *ar = pipe->ar;
178+
#ifdef INVARIANTS
176179
struct ath10k_pci *ar_pci = pipe->psc;
180+
#endif
177181
struct ath10k_ce_pipe *ce_pipe = pipe->ce_hdl;
178182
int ret, num;
179183

otus/freebsd/src/sys/dev/athp/if_athp_var.h

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ struct athp_keyidx_update {
6767
static inline void
6868
athp_mtx_assert(struct mtx *mtx, int op)
6969
{
70+
#ifdef INVARIANTS
7071
int ret;
7172

7273
ret = mtx_owned(mtx);
@@ -78,36 +79,65 @@ athp_mtx_assert(struct mtx *mtx, int op)
7879
printf("%s: failed assertion check (%s)", __func__,
7980
op == MA_OWNED ? "owned" : "not-owned");
8081
kdb_backtrace();
82+
#else
83+
(void) mtx;
84+
(void) op;
85+
#endif /* INVARIANTS */
8186
}
8287

8388
#define ATHP_NODE(ni) ((struct ath10k_sta *)(ni))
8489

8590
#define ATHP_LOCK(sc) mtx_lock(&(sc)->sc_mtx)
8691
#define ATHP_UNLOCK(sc) mtx_unlock(&(sc)->sc_mtx)
92+
#ifdef INVARIANTS
8793
#define ATHP_LOCK_ASSERT(sc) athp_mtx_assert(&(sc)->sc_mtx, MA_OWNED)
8894
#define ATHP_UNLOCK_ASSERT(sc) athp_mtx_assert(&(sc)->sc_mtx, MA_NOTOWNED)
89-
95+
#else
96+
#define ATHP_LOCK_ASSERT(sc) (void)0
97+
#define ATHP_UNLOCK_ASSERT(sc) (void)0
98+
#endif
9099
#define ATHP_FW_VER_STR 128
91100

92101
#define ATHP_CONF_LOCK(sc) mtx_lock(&(sc)->sc_conf_mtx)
93102
#define ATHP_CONF_UNLOCK(sc) mtx_unlock(&(sc)->sc_conf_mtx)
103+
#ifdef INVARIANTS
94104
#define ATHP_CONF_LOCK_ASSERT(sc) athp_mtx_assert(&(sc)->sc_conf_mtx, MA_OWNED)
95105
#define ATHP_CONF_UNLOCK_ASSERT(sc) athp_mtx_assert(&(sc)->sc_conf_mtx, MA_NOTOWNED)
106+
#else
107+
#define ATHP_CONF_LOCK_ASSERT(sc) (void)0
108+
#define ATHP_CONF_UNLOCK_ASSERT(sc) (void)0
109+
#endif
96110

97111
#define ATHP_DATA_LOCK(sc) mtx_lock(&(sc)->sc_data_mtx)
98112
#define ATHP_DATA_UNLOCK(sc) mtx_unlock(&(sc)->sc_data_mtx)
113+
#ifdef INVARIANTS
99114
#define ATHP_DATA_LOCK_ASSERT(sc) athp_mtx_assert(&(sc)->sc_data_mtx, MA_OWNED)
100115
#define ATHP_DATA_UNLOCK_ASSERT(sc) athp_mtx_assert(&(sc)->sc_data_mtx, MA_NOTOWNED)
116+
#else
117+
#define ATHP_DATA_LOCK_ASSERT(sc) (void)0
118+
#define ATHP_DATA_UNLOCK_ASSERT(sc) (void)0
119+
#endif
101120

102121
#define ATHP_BUF_LOCK(sc) mtx_lock(&(sc)->sc_buf_mtx)
103122
#define ATHP_BUF_UNLOCK(sc) mtx_unlock(&(sc)->sc_buf_mtx)
123+
#ifdef INVARIANTS
104124
#define ATHP_BUF_LOCK_ASSERT(sc) athp_mtx_assert(&(sc)->sc_buf_mtx, MA_OWNED)
105125
#define ATHP_BUF_UNLOCK_ASSERT(sc) athp_mtx_assert(&(sc)->sc_buf_mtx, MA_NOTOWNED)
126+
#else
127+
#define ATHP_BUF_LOCK_ASSERT(sc) (void)0
128+
#define ATHP_BUF_UNLOCK_ASSERT(sc) (void)0
129+
#endif
130+
106131

107132
#define ATHP_DMA_LOCK(sc) mtx_lock(&(sc)->sc_dma_mtx)
108133
#define ATHP_DMA_UNLOCK(sc) mtx_unlock(&(sc)->sc_dma_mtx)
134+
#ifdef INVARIANTS
109135
#define ATHP_DMA_LOCK_ASSERT(sc) athp_mtx_assert(&(sc)->sc_dma_mtx, MA_OWNED)
110136
#define ATHP_DMA_UNLOCK_ASSERT(sc) athp_mtx_assert(&(sc)->sc_dma_mtx, MA_NOTOWNED)
137+
#else
138+
#define ATHP_DMA_LOCK_ASSERT(sc) (void)0
139+
#define ATHP_DMA_UNLOCK_ASSERT(sc) (void)0
140+
#endif
111141

112142
/*
113143
* For now, we don't allocate hardware pairwise keys as hardware

0 commit comments

Comments
 (0)