Lines Matching refs:adap

6 static int cxgb4_mps_ref_dec_by_mac(struct adapter *adap,  in cxgb4_mps_ref_dec_by_mac()  argument
13 spin_lock_bh(&adap->mps_ref_lock); in cxgb4_mps_ref_dec_by_mac()
14 list_for_each_entry_safe(mps_entry, tmp, &adap->mps_ref, list) { in cxgb4_mps_ref_dec_by_mac()
18 spin_unlock_bh(&adap->mps_ref_lock); in cxgb4_mps_ref_dec_by_mac()
27 spin_unlock_bh(&adap->mps_ref_lock); in cxgb4_mps_ref_dec_by_mac()
31 static int cxgb4_mps_ref_dec(struct adapter *adap, u16 idx) in cxgb4_mps_ref_dec() argument
36 spin_lock(&adap->mps_ref_lock); in cxgb4_mps_ref_dec()
37 list_for_each_entry_safe(mps_entry, tmp, &adap->mps_ref, list) { in cxgb4_mps_ref_dec()
40 spin_unlock(&adap->mps_ref_lock); in cxgb4_mps_ref_dec()
49 spin_unlock(&adap->mps_ref_lock); in cxgb4_mps_ref_dec()
53 static int cxgb4_mps_ref_inc(struct adapter *adap, const u8 *mac_addr, in cxgb4_mps_ref_inc() argument
60 spin_lock_bh(&adap->mps_ref_lock); in cxgb4_mps_ref_inc()
61 list_for_each_entry(mps_entry, &adap->mps_ref, list) { in cxgb4_mps_ref_inc()
76 list_add_tail(&mps_entry->list, &adap->mps_ref); in cxgb4_mps_ref_inc()
78 spin_unlock_bh(&adap->mps_ref_lock); in cxgb4_mps_ref_inc()
82 int cxgb4_free_mac_filt(struct adapter *adap, unsigned int viid, in cxgb4_free_mac_filt() argument
88 if (!cxgb4_mps_ref_dec_by_mac(adap, addr[i], NULL)) { in cxgb4_free_mac_filt()
89 ret = t4_free_mac_filt(adap, adap->mbox, viid, in cxgb4_free_mac_filt()
100 int cxgb4_alloc_mac_filt(struct adapter *adap, unsigned int viid, in cxgb4_alloc_mac_filt() argument
106 ret = t4_alloc_mac_filt(adap, adap->mbox, viid, free, in cxgb4_alloc_mac_filt()
113 if (cxgb4_mps_ref_inc(adap, addr[i], idx[i], NULL)) { in cxgb4_alloc_mac_filt()
122 cxgb4_free_mac_filt(adap, viid, naddr, addr, sleep_ok); in cxgb4_alloc_mac_filt()
144 int cxgb4_free_raw_mac_filt(struct adapter *adap, in cxgb4_free_raw_mac_filt() argument
155 if (!cxgb4_mps_ref_dec(adap, idx)) in cxgb4_free_raw_mac_filt()
156 ret = t4_free_raw_mac_filt(adap, viid, addr, in cxgb4_free_raw_mac_filt()
163 int cxgb4_alloc_raw_mac_filt(struct adapter *adap, in cxgb4_alloc_raw_mac_filt() argument
174 ret = t4_alloc_raw_mac_filt(adap, viid, addr, in cxgb4_alloc_raw_mac_filt()
180 if (cxgb4_mps_ref_inc(adap, addr, ret, mask)) { in cxgb4_alloc_raw_mac_filt()
182 t4_free_raw_mac_filt(adap, viid, addr, in cxgb4_alloc_raw_mac_filt()
190 int cxgb4_free_encap_mac_filt(struct adapter *adap, unsigned int viid, in cxgb4_free_encap_mac_filt() argument
195 if (!cxgb4_mps_ref_dec(adap, idx)) in cxgb4_free_encap_mac_filt()
196 ret = t4_free_encap_mac_filt(adap, viid, idx, sleep_ok); in cxgb4_free_encap_mac_filt()
201 int cxgb4_alloc_encap_mac_filt(struct adapter *adap, unsigned int viid, in cxgb4_alloc_encap_mac_filt() argument
208 ret = t4_alloc_encap_mac_filt(adap, viid, addr, mask, vni, vni_mask, in cxgb4_alloc_encap_mac_filt()
213 if (cxgb4_mps_ref_inc(adap, addr, ret, mask)) { in cxgb4_alloc_encap_mac_filt()
215 t4_free_encap_mac_filt(adap, viid, ret, sleep_ok); in cxgb4_alloc_encap_mac_filt()
220 int cxgb4_init_mps_ref_entries(struct adapter *adap) in cxgb4_init_mps_ref_entries() argument
222 spin_lock_init(&adap->mps_ref_lock); in cxgb4_init_mps_ref_entries()
223 INIT_LIST_HEAD(&adap->mps_ref); in cxgb4_init_mps_ref_entries()
228 void cxgb4_free_mps_ref_entries(struct adapter *adap) in cxgb4_free_mps_ref_entries() argument
232 if (list_empty(&adap->mps_ref)) in cxgb4_free_mps_ref_entries()
235 spin_lock(&adap->mps_ref_lock); in cxgb4_free_mps_ref_entries()
236 list_for_each_entry_safe(mps_entry, tmp, &adap->mps_ref, list) { in cxgb4_free_mps_ref_entries()
240 spin_unlock(&adap->mps_ref_lock); in cxgb4_free_mps_ref_entries()