aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
diff options
context:
space:
mode:
authorArend van Spriel <arend@broadcom.com>2013-06-18 07:29:25 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-06-18 14:46:49 -0400
commit1ab083a3752760ec7751a7fa43db555d2d6f1e6a (patch)
tree1fb7a54258da130c07696ed6ce496e254f294a01 /drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
parentae66460989f1dd62da760c6123820d9741315260 (diff)
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: Hante Meuleman <meuleman@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c')
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c53
1 files changed, 26 insertions, 27 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
index b702f3e6d882..13e75c4b1a6b 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
@@ -631,8 +631,8 @@ static void brcmf_fws_macdesc_set_name(struct brcmf_fws_info *fws,
631 desc->interface_id); 631 desc->interface_id);
632} 632}
633 633
634static void brcmf_fws_init_mac_descriptor(struct brcmf_fws_mac_descriptor *desc, 634static void brcmf_fws_macdesc_init(struct brcmf_fws_mac_descriptor *desc,
635 u8 *addr, u8 ifidx) 635 u8 *addr, u8 ifidx)
636{ 636{
637 brcmf_dbg(TRACE, 637 brcmf_dbg(TRACE,
638 "enter: desc %p ea=%pM, ifidx=%u\n", desc, addr, ifidx); 638 "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} 648}
649 649
650static 650static
651void brcmf_fws_clear_mac_descriptor(struct brcmf_fws_mac_descriptor *desc) 651void brcmf_fws_macdesc_deinit(struct brcmf_fws_mac_descriptor *desc)
652{ 652{
653 brcmf_dbg(TRACE, 653 brcmf_dbg(TRACE,
654 "enter: ea=%pM, ifidx=%u\n", desc->ea, desc->interface_id); 654 "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} 659}
660 660
661static struct brcmf_fws_mac_descriptor * 661static struct brcmf_fws_mac_descriptor *
662brcmf_fws_mac_descriptor_lookup(struct brcmf_fws_info *fws, u8 *ea) 662brcmf_fws_macdesc_lookup(struct brcmf_fws_info *fws, u8 *ea)
663{ 663{
664 struct brcmf_fws_mac_descriptor *entry; 664 struct brcmf_fws_mac_descriptor *entry;
665 int i; 665 int i;
@@ -678,8 +678,7 @@ brcmf_fws_mac_descriptor_lookup(struct brcmf_fws_info *fws, u8 *ea)
678} 678}
679 679
680static struct brcmf_fws_mac_descriptor* 680static struct brcmf_fws_mac_descriptor*
681brcmf_fws_find_mac_desc(struct brcmf_fws_info *fws, struct brcmf_if *ifp, 681brcmf_fws_macdesc_find(struct brcmf_fws_info *fws, struct brcmf_if *ifp, u8 *da)
682 u8 *da)
683{ 682{
684 struct brcmf_fws_mac_descriptor *entry = &fws->desc.other; 683 struct brcmf_fws_mac_descriptor *entry = &fws->desc.other;
685 bool multicast; 684 bool multicast;
@@ -695,7 +694,7 @@ brcmf_fws_find_mac_desc(struct brcmf_fws_info *fws, struct brcmf_if *ifp,
695 goto done; 694 goto done;
696 } 695 }
697 696
698 entry = brcmf_fws_mac_descriptor_lookup(fws, da); 697 entry = brcmf_fws_macdesc_lookup(fws, da);
699 if (IS_ERR(entry)) 698 if (IS_ERR(entry))
700 entry = ifp->fws_desc; 699 entry = ifp->fws_desc;
701 700
@@ -703,9 +702,9 @@ done:
703 return entry; 702 return entry;
704} 703}
705 704
706static bool brcmf_fws_mac_desc_closed(struct brcmf_fws_info *fws, 705static bool brcmf_fws_macdesc_closed(struct brcmf_fws_info *fws,
707 struct brcmf_fws_mac_descriptor *entry, 706 struct brcmf_fws_mac_descriptor *entry,
708 int fifo) 707 int fifo)
709{ 708{
710 struct brcmf_fws_mac_descriptor *if_entry; 709 struct brcmf_fws_mac_descriptor *if_entry;
711 bool closed; 710 bool closed;
@@ -728,9 +727,9 @@ static bool brcmf_fws_mac_desc_closed(struct brcmf_fws_info *fws,
728 return closed || !(entry->ac_bitmap & BIT(fifo)); 727 return closed || !(entry->ac_bitmap & BIT(fifo));
729} 728}
730 729
731static void brcmf_fws_mac_desc_cleanup(struct brcmf_fws_info *fws, 730static void brcmf_fws_macdesc_cleanup(struct brcmf_fws_info *fws,
732 struct brcmf_fws_mac_descriptor *entry, 731 struct brcmf_fws_mac_descriptor *entry,
733 int ifidx) 732 int ifidx)
734{ 733{
735 if (entry->occupied && (ifidx == -1 || ifidx == entry->interface_id)) { 734 if (entry->occupied && (ifidx == -1 || ifidx == entry->interface_id)) {
736 brcmf_fws_psq_flush(fws, &entry->psq, ifidx); 735 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 /* cleanup individual nodes */ 781 /* cleanup individual nodes */
783 table = &fws->desc.nodes[0]; 782 table = &fws->desc.nodes[0];
784 for (i = 0; i < ARRAY_SIZE(fws->desc.nodes); i++) 783 for (i = 0; i < ARRAY_SIZE(fws->desc.nodes); i++)
785 brcmf_fws_mac_desc_cleanup(fws, &table[i], ifidx); 784 brcmf_fws_macdesc_cleanup(fws, &table[i], ifidx);
786 785
787 brcmf_fws_mac_desc_cleanup(fws, &fws->desc.other, ifidx); 786 brcmf_fws_macdesc_cleanup(fws, &fws->desc.other, ifidx);
788 brcmf_fws_bus_txq_cleanup(fws, matchfn, ifidx); 787 brcmf_fws_bus_txq_cleanup(fws, matchfn, ifidx);
789 brcmf_fws_hanger_cleanup(fws, matchfn, ifidx); 788 brcmf_fws_hanger_cleanup(fws, matchfn, ifidx);
790} 789}
@@ -924,18 +923,18 @@ int brcmf_fws_macdesc_indicate(struct brcmf_fws_info *fws, u8 type, u8 *data)
924 if (entry->occupied) { 923 if (entry->occupied) {
925 brcmf_dbg(TRACE, "deleting %s mac %pM\n", 924 brcmf_dbg(TRACE, "deleting %s mac %pM\n",
926 entry->name, addr); 925 entry->name, addr);
927 brcmf_fws_mac_desc_cleanup(fws, entry, -1); 926 brcmf_fws_macdesc_cleanup(fws, entry, -1);
928 brcmf_fws_clear_mac_descriptor(entry); 927 brcmf_fws_macdesc_deinit(entry);
929 } else 928 } else
930 fws->stats.mac_update_failed++; 929 fws->stats.mac_update_failed++;
931 return 0; 930 return 0;
932 } 931 }
933 932
934 existing = brcmf_fws_mac_descriptor_lookup(fws, addr); 933 existing = brcmf_fws_macdesc_lookup(fws, addr);
935 if (IS_ERR(existing)) { 934 if (IS_ERR(existing)) {
936 if (!entry->occupied) { 935 if (!entry->occupied) {
937 entry->mac_handle = mac_handle; 936 entry->mac_handle = mac_handle;
938 brcmf_fws_init_mac_descriptor(entry, addr, ifidx); 937 brcmf_fws_macdesc_init(entry, addr, ifidx);
939 brcmf_fws_macdesc_set_name(fws, entry); 938 brcmf_fws_macdesc_set_name(fws, entry);
940 brcmu_pktq_init(&entry->psq, BRCMF_FWS_PSQ_PREC_COUNT, 939 brcmu_pktq_init(&entry->psq, BRCMF_FWS_PSQ_PREC_COUNT,
941 BRCMF_FWS_PSQ_LEN); 940 BRCMF_FWS_PSQ_LEN);
@@ -949,7 +948,7 @@ int brcmf_fws_macdesc_indicate(struct brcmf_fws_info *fws, u8 type, u8 *data)
949 memcpy(entry, existing, 948 memcpy(entry, existing,
950 offsetof(struct brcmf_fws_mac_descriptor, psq)); 949 offsetof(struct brcmf_fws_mac_descriptor, psq));
951 entry->mac_handle = mac_handle; 950 entry->mac_handle = mac_handle;
952 brcmf_fws_clear_mac_descriptor(existing); 951 brcmf_fws_macdesc_deinit(existing);
953 brcmf_fws_macdesc_set_name(fws, entry); 952 brcmf_fws_macdesc_set_name(fws, entry);
954 brcmf_dbg(TRACE, "relocate %s mac %pM\n", entry->name, 953 brcmf_dbg(TRACE, "relocate %s mac %pM\n", entry->name,
955 addr); 954 addr);
@@ -1189,7 +1188,7 @@ static struct sk_buff *brcmf_fws_deq(struct brcmf_fws_info *fws, int fifo)
1189 for (i = 0; i < num_nodes; i++) { 1188 for (i = 0; i < num_nodes; i++) {
1190 entry = &table[(node_pos + i) % num_nodes]; 1189 entry = &table[(node_pos + i) % num_nodes];
1191 if (!entry->occupied || 1190 if (!entry->occupied ||
1192 brcmf_fws_mac_desc_closed(fws, entry, fifo)) 1191 brcmf_fws_macdesc_closed(fws, entry, fifo))
1193 continue; 1192 continue;
1194 1193
1195 if (entry->suppressed) 1194 if (entry->suppressed)
@@ -1810,7 +1809,7 @@ int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb)
1810 1809
1811 /* set control buffer information */ 1810 /* set control buffer information */
1812 skcb->if_flags = 0; 1811 skcb->if_flags = 0;
1813 skcb->mac = brcmf_fws_find_mac_desc(fws, ifp, eh->h_dest); 1812 skcb->mac = brcmf_fws_macdesc_find(fws, ifp, eh->h_dest);
1814 skcb->state = BRCMF_FWS_SKBSTATE_NEW; 1813 skcb->state = BRCMF_FWS_SKBSTATE_NEW;
1815 brcmf_skb_if_flags_set_field(skb, INDEX, ifp->ifidx); 1814 brcmf_skb_if_flags_set_field(skb, INDEX, ifp->ifidx);
1816 if (!multicast) 1815 if (!multicast)
@@ -1828,7 +1827,7 @@ int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb)
1828 1827
1829 if (skcb->mac->suppressed || 1828 if (skcb->mac->suppressed ||
1830 fws->bus_flow_blocked || 1829 fws->bus_flow_blocked ||
1831 brcmf_fws_mac_desc_closed(fws, skcb->mac, fifo) || 1830 brcmf_fws_macdesc_closed(fws, skcb->mac, fifo) ||
1832 brcmu_pktq_mlen(&skcb->mac->psq, 3 << (fifo * 2)) || 1831 brcmu_pktq_mlen(&skcb->mac->psq, 3 << (fifo * 2)) ||
1833 (!multicast && 1832 (!multicast &&
1834 brcmf_fws_consume_credit(fws, fifo, skb) < 0)) { 1833 brcmf_fws_consume_credit(fws, fifo, skb) < 0)) {
@@ -1850,7 +1849,7 @@ void brcmf_fws_reset_interface(struct brcmf_if *ifp)
1850 if (!entry) 1849 if (!entry)
1851 return; 1850 return;
1852 1851
1853 brcmf_fws_init_mac_descriptor(entry, ifp->mac_addr, ifp->ifidx); 1852 brcmf_fws_macdesc_init(entry, ifp->mac_addr, ifp->ifidx);
1854} 1853}
1855 1854
1856void brcmf_fws_add_interface(struct brcmf_if *ifp) 1855void brcmf_fws_add_interface(struct brcmf_if *ifp)
@@ -1863,7 +1862,7 @@ void brcmf_fws_add_interface(struct brcmf_if *ifp)
1863 1862
1864 entry = &fws->desc.iface[ifp->ifidx]; 1863 entry = &fws->desc.iface[ifp->ifidx];
1865 ifp->fws_desc = entry; 1864 ifp->fws_desc = entry;
1866 brcmf_fws_init_mac_descriptor(entry, ifp->mac_addr, ifp->ifidx); 1865 brcmf_fws_macdesc_init(entry, ifp->mac_addr, ifp->ifidx);
1867 brcmf_fws_macdesc_set_name(fws, entry); 1866 brcmf_fws_macdesc_set_name(fws, entry);
1868 brcmu_pktq_init(&entry->psq, BRCMF_FWS_PSQ_PREC_COUNT, 1867 brcmu_pktq_init(&entry->psq, BRCMF_FWS_PSQ_PREC_COUNT,
1869 BRCMF_FWS_PSQ_LEN); 1868 BRCMF_FWS_PSQ_LEN);
@@ -1881,7 +1880,7 @@ void brcmf_fws_del_interface(struct brcmf_if *ifp)
1881 brcmf_fws_lock(ifp->drvr, flags); 1880 brcmf_fws_lock(ifp->drvr, flags);
1882 ifp->fws_desc = NULL; 1881 ifp->fws_desc = NULL;
1883 brcmf_dbg(TRACE, "deleting %s\n", entry->name); 1882 brcmf_dbg(TRACE, "deleting %s\n", entry->name);
1884 brcmf_fws_clear_mac_descriptor(entry); 1883 brcmf_fws_macdesc_deinit(entry);
1885 brcmf_fws_cleanup(ifp->drvr->fws, ifp->ifidx); 1884 brcmf_fws_cleanup(ifp->drvr->fws, ifp->ifidx);
1886 brcmf_fws_unlock(ifp->drvr, flags); 1885 brcmf_fws_unlock(ifp->drvr, flags);
1887} 1886}
@@ -1986,7 +1985,7 @@ int brcmf_fws_init(struct brcmf_pub *drvr)
1986 } 1985 }
1987 1986
1988 brcmf_fws_hanger_init(&drvr->fws->hanger); 1987 brcmf_fws_hanger_init(&drvr->fws->hanger);
1989 brcmf_fws_init_mac_descriptor(&drvr->fws->desc.other, NULL, 0); 1988 brcmf_fws_macdesc_init(&drvr->fws->desc.other, NULL, 0);
1990 brcmf_fws_macdesc_set_name(drvr->fws, &drvr->fws->desc.other); 1989 brcmf_fws_macdesc_set_name(drvr->fws, &drvr->fws->desc.other);
1991 brcmu_pktq_init(&drvr->fws->desc.other.psq, BRCMF_FWS_PSQ_PREC_COUNT, 1990 brcmu_pktq_init(&drvr->fws->desc.other.psq, BRCMF_FWS_PSQ_PREC_COUNT,
1992 BRCMF_FWS_PSQ_LEN); 1991 BRCMF_FWS_PSQ_LEN);