Commit 1ab083a3 authored by Arend van Spriel's avatar Arend van Spriel Committed by John W. Linville

brcmfmac: consolidate mac_descriptor related function names

Just cleaning up and being consistent in naming operations
related to struct brcmf_fws_mac_descriptor objects.
Reviewed-by: default avatarHante Meuleman <meuleman@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent ae664609
...@@ -631,8 +631,8 @@ static void brcmf_fws_macdesc_set_name(struct brcmf_fws_info *fws, ...@@ -631,8 +631,8 @@ static void brcmf_fws_macdesc_set_name(struct brcmf_fws_info *fws,
desc->interface_id); desc->interface_id);
} }
static void brcmf_fws_init_mac_descriptor(struct brcmf_fws_mac_descriptor *desc, static void brcmf_fws_macdesc_init(struct brcmf_fws_mac_descriptor *desc,
u8 *addr, u8 ifidx) u8 *addr, u8 ifidx)
{ {
brcmf_dbg(TRACE, brcmf_dbg(TRACE,
"enter: desc %p ea=%pM, ifidx=%u\n", desc, addr, ifidx); "enter: desc %p ea=%pM, ifidx=%u\n", desc, addr, ifidx);
...@@ -648,7 +648,7 @@ static void brcmf_fws_init_mac_descriptor(struct brcmf_fws_mac_descriptor *desc, ...@@ -648,7 +648,7 @@ static void brcmf_fws_init_mac_descriptor(struct brcmf_fws_mac_descriptor *desc,
} }
static static
void brcmf_fws_clear_mac_descriptor(struct brcmf_fws_mac_descriptor *desc) void brcmf_fws_macdesc_deinit(struct brcmf_fws_mac_descriptor *desc)
{ {
brcmf_dbg(TRACE, brcmf_dbg(TRACE,
"enter: ea=%pM, ifidx=%u\n", desc->ea, desc->interface_id); "enter: ea=%pM, ifidx=%u\n", desc->ea, desc->interface_id);
...@@ -659,7 +659,7 @@ void brcmf_fws_clear_mac_descriptor(struct brcmf_fws_mac_descriptor *desc) ...@@ -659,7 +659,7 @@ void brcmf_fws_clear_mac_descriptor(struct brcmf_fws_mac_descriptor *desc)
} }
static struct brcmf_fws_mac_descriptor * static struct brcmf_fws_mac_descriptor *
brcmf_fws_mac_descriptor_lookup(struct brcmf_fws_info *fws, u8 *ea) brcmf_fws_macdesc_lookup(struct brcmf_fws_info *fws, u8 *ea)
{ {
struct brcmf_fws_mac_descriptor *entry; struct brcmf_fws_mac_descriptor *entry;
int i; int i;
...@@ -678,8 +678,7 @@ brcmf_fws_mac_descriptor_lookup(struct brcmf_fws_info *fws, u8 *ea) ...@@ -678,8 +678,7 @@ brcmf_fws_mac_descriptor_lookup(struct brcmf_fws_info *fws, u8 *ea)
} }
static struct brcmf_fws_mac_descriptor* static struct brcmf_fws_mac_descriptor*
brcmf_fws_find_mac_desc(struct brcmf_fws_info *fws, struct brcmf_if *ifp, brcmf_fws_macdesc_find(struct brcmf_fws_info *fws, struct brcmf_if *ifp, u8 *da)
u8 *da)
{ {
struct brcmf_fws_mac_descriptor *entry = &fws->desc.other; struct brcmf_fws_mac_descriptor *entry = &fws->desc.other;
bool multicast; bool multicast;
...@@ -695,7 +694,7 @@ brcmf_fws_find_mac_desc(struct brcmf_fws_info *fws, struct brcmf_if *ifp, ...@@ -695,7 +694,7 @@ brcmf_fws_find_mac_desc(struct brcmf_fws_info *fws, struct brcmf_if *ifp,
goto done; goto done;
} }
entry = brcmf_fws_mac_descriptor_lookup(fws, da); entry = brcmf_fws_macdesc_lookup(fws, da);
if (IS_ERR(entry)) if (IS_ERR(entry))
entry = ifp->fws_desc; entry = ifp->fws_desc;
...@@ -703,9 +702,9 @@ brcmf_fws_find_mac_desc(struct brcmf_fws_info *fws, struct brcmf_if *ifp, ...@@ -703,9 +702,9 @@ brcmf_fws_find_mac_desc(struct brcmf_fws_info *fws, struct brcmf_if *ifp,
return entry; return entry;
} }
static bool brcmf_fws_mac_desc_closed(struct brcmf_fws_info *fws, static bool brcmf_fws_macdesc_closed(struct brcmf_fws_info *fws,
struct brcmf_fws_mac_descriptor *entry, struct brcmf_fws_mac_descriptor *entry,
int fifo) int fifo)
{ {
struct brcmf_fws_mac_descriptor *if_entry; struct brcmf_fws_mac_descriptor *if_entry;
bool closed; bool closed;
...@@ -728,9 +727,9 @@ static bool brcmf_fws_mac_desc_closed(struct brcmf_fws_info *fws, ...@@ -728,9 +727,9 @@ static bool brcmf_fws_mac_desc_closed(struct brcmf_fws_info *fws,
return closed || !(entry->ac_bitmap & BIT(fifo)); return closed || !(entry->ac_bitmap & BIT(fifo));
} }
static void brcmf_fws_mac_desc_cleanup(struct brcmf_fws_info *fws, static void brcmf_fws_macdesc_cleanup(struct brcmf_fws_info *fws,
struct brcmf_fws_mac_descriptor *entry, struct brcmf_fws_mac_descriptor *entry,
int ifidx) int ifidx)
{ {
if (entry->occupied && (ifidx == -1 || ifidx == entry->interface_id)) { if (entry->occupied && (ifidx == -1 || ifidx == entry->interface_id)) {
brcmf_fws_psq_flush(fws, &entry->psq, ifidx); brcmf_fws_psq_flush(fws, &entry->psq, ifidx);
...@@ -782,9 +781,9 @@ static void brcmf_fws_cleanup(struct brcmf_fws_info *fws, int ifidx) ...@@ -782,9 +781,9 @@ static void brcmf_fws_cleanup(struct brcmf_fws_info *fws, int ifidx)
/* cleanup individual nodes */ /* cleanup individual nodes */
table = &fws->desc.nodes[0]; table = &fws->desc.nodes[0];
for (i = 0; i < ARRAY_SIZE(fws->desc.nodes); i++) for (i = 0; i < ARRAY_SIZE(fws->desc.nodes); i++)
brcmf_fws_mac_desc_cleanup(fws, &table[i], ifidx); brcmf_fws_macdesc_cleanup(fws, &table[i], ifidx);
brcmf_fws_mac_desc_cleanup(fws, &fws->desc.other, ifidx); brcmf_fws_macdesc_cleanup(fws, &fws->desc.other, ifidx);
brcmf_fws_bus_txq_cleanup(fws, matchfn, ifidx); brcmf_fws_bus_txq_cleanup(fws, matchfn, ifidx);
brcmf_fws_hanger_cleanup(fws, matchfn, ifidx); brcmf_fws_hanger_cleanup(fws, matchfn, ifidx);
} }
...@@ -924,18 +923,18 @@ int brcmf_fws_macdesc_indicate(struct brcmf_fws_info *fws, u8 type, u8 *data) ...@@ -924,18 +923,18 @@ int brcmf_fws_macdesc_indicate(struct brcmf_fws_info *fws, u8 type, u8 *data)
if (entry->occupied) { if (entry->occupied) {
brcmf_dbg(TRACE, "deleting %s mac %pM\n", brcmf_dbg(TRACE, "deleting %s mac %pM\n",
entry->name, addr); entry->name, addr);
brcmf_fws_mac_desc_cleanup(fws, entry, -1); brcmf_fws_macdesc_cleanup(fws, entry, -1);
brcmf_fws_clear_mac_descriptor(entry); brcmf_fws_macdesc_deinit(entry);
} else } else
fws->stats.mac_update_failed++; fws->stats.mac_update_failed++;
return 0; return 0;
} }
existing = brcmf_fws_mac_descriptor_lookup(fws, addr); existing = brcmf_fws_macdesc_lookup(fws, addr);
if (IS_ERR(existing)) { if (IS_ERR(existing)) {
if (!entry->occupied) { if (!entry->occupied) {
entry->mac_handle = mac_handle; entry->mac_handle = mac_handle;
brcmf_fws_init_mac_descriptor(entry, addr, ifidx); brcmf_fws_macdesc_init(entry, addr, ifidx);
brcmf_fws_macdesc_set_name(fws, entry); brcmf_fws_macdesc_set_name(fws, entry);
brcmu_pktq_init(&entry->psq, BRCMF_FWS_PSQ_PREC_COUNT, brcmu_pktq_init(&entry->psq, BRCMF_FWS_PSQ_PREC_COUNT,
BRCMF_FWS_PSQ_LEN); BRCMF_FWS_PSQ_LEN);
...@@ -949,7 +948,7 @@ int brcmf_fws_macdesc_indicate(struct brcmf_fws_info *fws, u8 type, u8 *data) ...@@ -949,7 +948,7 @@ int brcmf_fws_macdesc_indicate(struct brcmf_fws_info *fws, u8 type, u8 *data)
memcpy(entry, existing, memcpy(entry, existing,
offsetof(struct brcmf_fws_mac_descriptor, psq)); offsetof(struct brcmf_fws_mac_descriptor, psq));
entry->mac_handle = mac_handle; entry->mac_handle = mac_handle;
brcmf_fws_clear_mac_descriptor(existing); brcmf_fws_macdesc_deinit(existing);
brcmf_fws_macdesc_set_name(fws, entry); brcmf_fws_macdesc_set_name(fws, entry);
brcmf_dbg(TRACE, "relocate %s mac %pM\n", entry->name, brcmf_dbg(TRACE, "relocate %s mac %pM\n", entry->name,
addr); addr);
...@@ -1189,7 +1188,7 @@ static struct sk_buff *brcmf_fws_deq(struct brcmf_fws_info *fws, int fifo) ...@@ -1189,7 +1188,7 @@ static struct sk_buff *brcmf_fws_deq(struct brcmf_fws_info *fws, int fifo)
for (i = 0; i < num_nodes; i++) { for (i = 0; i < num_nodes; i++) {
entry = &table[(node_pos + i) % num_nodes]; entry = &table[(node_pos + i) % num_nodes];
if (!entry->occupied || if (!entry->occupied ||
brcmf_fws_mac_desc_closed(fws, entry, fifo)) brcmf_fws_macdesc_closed(fws, entry, fifo))
continue; continue;
if (entry->suppressed) if (entry->suppressed)
...@@ -1810,7 +1809,7 @@ int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb) ...@@ -1810,7 +1809,7 @@ int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb)
/* set control buffer information */ /* set control buffer information */
skcb->if_flags = 0; skcb->if_flags = 0;
skcb->mac = brcmf_fws_find_mac_desc(fws, ifp, eh->h_dest); skcb->mac = brcmf_fws_macdesc_find(fws, ifp, eh->h_dest);
skcb->state = BRCMF_FWS_SKBSTATE_NEW; skcb->state = BRCMF_FWS_SKBSTATE_NEW;
brcmf_skb_if_flags_set_field(skb, INDEX, ifp->ifidx); brcmf_skb_if_flags_set_field(skb, INDEX, ifp->ifidx);
if (!multicast) if (!multicast)
...@@ -1828,7 +1827,7 @@ int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb) ...@@ -1828,7 +1827,7 @@ int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb)
if (skcb->mac->suppressed || if (skcb->mac->suppressed ||
fws->bus_flow_blocked || fws->bus_flow_blocked ||
brcmf_fws_mac_desc_closed(fws, skcb->mac, fifo) || brcmf_fws_macdesc_closed(fws, skcb->mac, fifo) ||
brcmu_pktq_mlen(&skcb->mac->psq, 3 << (fifo * 2)) || brcmu_pktq_mlen(&skcb->mac->psq, 3 << (fifo * 2)) ||
(!multicast && (!multicast &&
brcmf_fws_consume_credit(fws, fifo, skb) < 0)) { brcmf_fws_consume_credit(fws, fifo, skb) < 0)) {
...@@ -1850,7 +1849,7 @@ void brcmf_fws_reset_interface(struct brcmf_if *ifp) ...@@ -1850,7 +1849,7 @@ void brcmf_fws_reset_interface(struct brcmf_if *ifp)
if (!entry) if (!entry)
return; return;
brcmf_fws_init_mac_descriptor(entry, ifp->mac_addr, ifp->ifidx); brcmf_fws_macdesc_init(entry, ifp->mac_addr, ifp->ifidx);
} }
void brcmf_fws_add_interface(struct brcmf_if *ifp) void brcmf_fws_add_interface(struct brcmf_if *ifp)
...@@ -1863,7 +1862,7 @@ void brcmf_fws_add_interface(struct brcmf_if *ifp) ...@@ -1863,7 +1862,7 @@ void brcmf_fws_add_interface(struct brcmf_if *ifp)
entry = &fws->desc.iface[ifp->ifidx]; entry = &fws->desc.iface[ifp->ifidx];
ifp->fws_desc = entry; ifp->fws_desc = entry;
brcmf_fws_init_mac_descriptor(entry, ifp->mac_addr, ifp->ifidx); brcmf_fws_macdesc_init(entry, ifp->mac_addr, ifp->ifidx);
brcmf_fws_macdesc_set_name(fws, entry); brcmf_fws_macdesc_set_name(fws, entry);
brcmu_pktq_init(&entry->psq, BRCMF_FWS_PSQ_PREC_COUNT, brcmu_pktq_init(&entry->psq, BRCMF_FWS_PSQ_PREC_COUNT,
BRCMF_FWS_PSQ_LEN); BRCMF_FWS_PSQ_LEN);
...@@ -1881,7 +1880,7 @@ void brcmf_fws_del_interface(struct brcmf_if *ifp) ...@@ -1881,7 +1880,7 @@ void brcmf_fws_del_interface(struct brcmf_if *ifp)
brcmf_fws_lock(ifp->drvr, flags); brcmf_fws_lock(ifp->drvr, flags);
ifp->fws_desc = NULL; ifp->fws_desc = NULL;
brcmf_dbg(TRACE, "deleting %s\n", entry->name); brcmf_dbg(TRACE, "deleting %s\n", entry->name);
brcmf_fws_clear_mac_descriptor(entry); brcmf_fws_macdesc_deinit(entry);
brcmf_fws_cleanup(ifp->drvr->fws, ifp->ifidx); brcmf_fws_cleanup(ifp->drvr->fws, ifp->ifidx);
brcmf_fws_unlock(ifp->drvr, flags); brcmf_fws_unlock(ifp->drvr, flags);
} }
...@@ -1986,7 +1985,7 @@ int brcmf_fws_init(struct brcmf_pub *drvr) ...@@ -1986,7 +1985,7 @@ int brcmf_fws_init(struct brcmf_pub *drvr)
} }
brcmf_fws_hanger_init(&drvr->fws->hanger); brcmf_fws_hanger_init(&drvr->fws->hanger);
brcmf_fws_init_mac_descriptor(&drvr->fws->desc.other, NULL, 0); brcmf_fws_macdesc_init(&drvr->fws->desc.other, NULL, 0);
brcmf_fws_macdesc_set_name(drvr->fws, &drvr->fws->desc.other); brcmf_fws_macdesc_set_name(drvr->fws, &drvr->fws->desc.other);
brcmu_pktq_init(&drvr->fws->desc.other.psq, BRCMF_FWS_PSQ_PREC_COUNT, brcmu_pktq_init(&drvr->fws->desc.other.psq, BRCMF_FWS_PSQ_PREC_COUNT,
BRCMF_FWS_PSQ_LEN); BRCMF_FWS_PSQ_LEN);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment