Lines Matching refs:flow
43 brcmf_flowring_is_tdls_mac(struct brcmf_flowring *flow, u8 mac[ETH_ALEN]) in brcmf_flowring_is_tdls_mac() argument
47 search = flow->tdls_entry; in brcmf_flowring_is_tdls_mac()
59 u32 brcmf_flowring_lookup(struct brcmf_flowring *flow, u8 da[ETH_ALEN], in brcmf_flowring_lookup() argument
71 sta = (flow->addr_mode[ifidx] == ADDR_INDIRECT); in brcmf_flowring_lookup()
77 if ((sta) && (flow->tdls_active) && in brcmf_flowring_lookup()
78 (brcmf_flowring_is_tdls_mac(flow, da))) { in brcmf_flowring_lookup()
85 hash = flow->hash; in brcmf_flowring_lookup()
103 u32 brcmf_flowring_create(struct brcmf_flowring *flow, u8 da[ETH_ALEN], in brcmf_flowring_create() argument
116 sta = (flow->addr_mode[ifidx] == ADDR_INDIRECT); in brcmf_flowring_create()
122 if ((sta) && (flow->tdls_active) && in brcmf_flowring_create()
123 (brcmf_flowring_is_tdls_mac(flow, da))) { in brcmf_flowring_create()
130 hash = flow->hash; in brcmf_flowring_create()
141 for (i = 0; i < flow->nrofrings; i++) { in brcmf_flowring_create()
142 if (flow->rings[i] == NULL) in brcmf_flowring_create()
145 if (i == flow->nrofrings) in brcmf_flowring_create()
160 flow->rings[i] = ring; in brcmf_flowring_create()
168 u8 brcmf_flowring_tid(struct brcmf_flowring *flow, u16 flowid) in brcmf_flowring_tid() argument
172 ring = flow->rings[flowid]; in brcmf_flowring_tid()
174 return flow->hash[ring->hash_id].fifo; in brcmf_flowring_tid()
178 static void brcmf_flowring_block(struct brcmf_flowring *flow, u16 flowid, in brcmf_flowring_block() argument
190 spin_lock_irqsave(&flow->block_lock, flags); in brcmf_flowring_block()
192 ring = flow->rings[flowid]; in brcmf_flowring_block()
194 spin_unlock_irqrestore(&flow->block_lock, flags); in brcmf_flowring_block()
197 ifidx = brcmf_flowring_ifidx_get(flow, flowid); in brcmf_flowring_block()
200 for (i = 0; i < flow->nrofrings; i++) { in brcmf_flowring_block()
201 if ((flow->rings[i]) && (i != flowid)) { in brcmf_flowring_block()
202 ring = flow->rings[i]; in brcmf_flowring_block()
204 (brcmf_flowring_ifidx_get(flow, i) == ifidx)) { in brcmf_flowring_block()
212 flow->rings[flowid]->blocked = blocked; in brcmf_flowring_block()
214 spin_unlock_irqrestore(&flow->block_lock, flags); in brcmf_flowring_block()
218 bus_if = dev_get_drvdata(flow->dev); in brcmf_flowring_block()
223 spin_unlock_irqrestore(&flow->block_lock, flags); in brcmf_flowring_block()
227 void brcmf_flowring_delete(struct brcmf_flowring *flow, u16 flowid) in brcmf_flowring_delete() argument
229 struct brcmf_bus *bus_if = dev_get_drvdata(flow->dev); in brcmf_flowring_delete()
236 ring = flow->rings[flowid]; in brcmf_flowring_delete()
240 ifidx = brcmf_flowring_ifidx_get(flow, flowid); in brcmf_flowring_delete()
243 brcmf_flowring_block(flow, flowid, false); in brcmf_flowring_delete()
245 flow->hash[hash_idx].ifidx = BRCMF_FLOWRING_INVALID_IFIDX; in brcmf_flowring_delete()
246 eth_zero_addr(flow->hash[hash_idx].mac); in brcmf_flowring_delete()
247 flow->rings[flowid] = NULL; in brcmf_flowring_delete()
259 u32 brcmf_flowring_enqueue(struct brcmf_flowring *flow, u16 flowid, in brcmf_flowring_enqueue() argument
264 ring = flow->rings[flowid]; in brcmf_flowring_enqueue()
270 brcmf_flowring_block(flow, flowid, true); in brcmf_flowring_enqueue()
279 brcmf_flowring_block(flow, flowid, false); in brcmf_flowring_enqueue()
285 struct sk_buff *brcmf_flowring_dequeue(struct brcmf_flowring *flow, u16 flowid) in brcmf_flowring_dequeue() argument
290 ring = flow->rings[flowid]; in brcmf_flowring_dequeue()
298 brcmf_flowring_block(flow, flowid, false); in brcmf_flowring_dequeue()
306 void brcmf_flowring_reinsert(struct brcmf_flowring *flow, u16 flowid, in brcmf_flowring_reinsert() argument
311 ring = flow->rings[flowid]; in brcmf_flowring_reinsert()
317 u32 brcmf_flowring_qlen(struct brcmf_flowring *flow, u16 flowid) in brcmf_flowring_qlen() argument
321 ring = flow->rings[flowid]; in brcmf_flowring_qlen()
332 void brcmf_flowring_open(struct brcmf_flowring *flow, u16 flowid) in brcmf_flowring_open() argument
336 ring = flow->rings[flowid]; in brcmf_flowring_open()
346 u8 brcmf_flowring_ifidx_get(struct brcmf_flowring *flow, u16 flowid) in brcmf_flowring_ifidx_get() argument
351 ring = flow->rings[flowid]; in brcmf_flowring_ifidx_get()
354 return flow->hash[hash_idx].ifidx; in brcmf_flowring_ifidx_get()
360 struct brcmf_flowring *flow; in brcmf_flowring_attach() local
363 flow = kzalloc(sizeof(*flow), GFP_KERNEL); in brcmf_flowring_attach()
364 if (flow) { in brcmf_flowring_attach()
365 flow->dev = dev; in brcmf_flowring_attach()
366 flow->nrofrings = nrofrings; in brcmf_flowring_attach()
367 spin_lock_init(&flow->block_lock); in brcmf_flowring_attach()
368 for (i = 0; i < ARRAY_SIZE(flow->addr_mode); i++) in brcmf_flowring_attach()
369 flow->addr_mode[i] = ADDR_INDIRECT; in brcmf_flowring_attach()
370 for (i = 0; i < ARRAY_SIZE(flow->hash); i++) in brcmf_flowring_attach()
371 flow->hash[i].ifidx = BRCMF_FLOWRING_INVALID_IFIDX; in brcmf_flowring_attach()
372 flow->rings = kcalloc(nrofrings, sizeof(*flow->rings), in brcmf_flowring_attach()
374 if (!flow->rings) { in brcmf_flowring_attach()
375 kfree(flow); in brcmf_flowring_attach()
376 flow = NULL; in brcmf_flowring_attach()
380 return flow; in brcmf_flowring_attach()
384 void brcmf_flowring_detach(struct brcmf_flowring *flow) in brcmf_flowring_detach() argument
386 struct brcmf_bus *bus_if = dev_get_drvdata(flow->dev); in brcmf_flowring_detach()
392 for (flowid = 0; flowid < flow->nrofrings; flowid++) { in brcmf_flowring_detach()
393 if (flow->rings[flowid]) in brcmf_flowring_detach()
397 search = flow->tdls_entry; in brcmf_flowring_detach()
403 kfree(flow->rings); in brcmf_flowring_detach()
404 kfree(flow); in brcmf_flowring_detach()
408 void brcmf_flowring_configure_addr_mode(struct brcmf_flowring *flow, int ifidx, in brcmf_flowring_configure_addr_mode() argument
411 struct brcmf_bus *bus_if = dev_get_drvdata(flow->dev); in brcmf_flowring_configure_addr_mode()
416 if (flow->addr_mode[ifidx] != addr_mode) { in brcmf_flowring_configure_addr_mode()
417 for (i = 0; i < ARRAY_SIZE(flow->hash); i++) { in brcmf_flowring_configure_addr_mode()
418 if (flow->hash[i].ifidx == ifidx) { in brcmf_flowring_configure_addr_mode()
419 flowid = flow->hash[i].flowid; in brcmf_flowring_configure_addr_mode()
420 if (flow->rings[flowid]->status != RING_OPEN) in brcmf_flowring_configure_addr_mode()
422 flow->rings[flowid]->status = RING_CLOSING; in brcmf_flowring_configure_addr_mode()
426 flow->addr_mode[ifidx] = addr_mode; in brcmf_flowring_configure_addr_mode()
431 void brcmf_flowring_delete_peer(struct brcmf_flowring *flow, int ifidx, in brcmf_flowring_delete_peer() argument
434 struct brcmf_bus *bus_if = dev_get_drvdata(flow->dev); in brcmf_flowring_delete_peer()
443 sta = (flow->addr_mode[ifidx] == ADDR_INDIRECT); in brcmf_flowring_delete_peer()
445 search = flow->tdls_entry; in brcmf_flowring_delete_peer()
456 hash = flow->hash; in brcmf_flowring_delete_peer()
460 flowid = flow->hash[i].flowid; in brcmf_flowring_delete_peer()
461 if (flow->rings[flowid]->status == RING_OPEN) { in brcmf_flowring_delete_peer()
462 flow->rings[flowid]->status = RING_CLOSING; in brcmf_flowring_delete_peer()
472 flow->tdls_entry = search->next; in brcmf_flowring_delete_peer()
474 if (flow->tdls_entry == NULL) in brcmf_flowring_delete_peer()
475 flow->tdls_active = false; in brcmf_flowring_delete_peer()
480 void brcmf_flowring_add_tdls_peer(struct brcmf_flowring *flow, int ifidx, in brcmf_flowring_add_tdls_peer() argument
492 if (flow->tdls_entry == NULL) { in brcmf_flowring_add_tdls_peer()
493 flow->tdls_entry = tdls_entry; in brcmf_flowring_add_tdls_peer()
495 search = flow->tdls_entry; in brcmf_flowring_add_tdls_peer()
506 flow->tdls_active = true; in brcmf_flowring_add_tdls_peer()