summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorArend van Spriel <arend@broadcom.com>2013-04-03 12:40:47 +0200
committerJohn W. Linville <linville@tuxdriver.com>2013-04-03 15:07:08 -0400
commitd9337414e87259fae13693796f7ad897b1b7f8e1 (patch)
treee38c2373fd1bf2703d68457c4048cc8520d119b7 /drivers
parent946072383b6f93839e4ff79ffe44cfffa3aeb2d0 (diff)
brcmfmac: move brcmf_fws_{de,}init() functions
The functions are moved in preparation of later patches. Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Piotr Haber <phaber@broadcom.com> 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')
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c136
1 files changed, 68 insertions, 68 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
index 6da9f82b9b1..8b09973309c 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
@@ -900,74 +900,6 @@ static int brcmf_fws_notify_credit_map(struct brcmf_if *ifp,
return 0;
}
-int brcmf_fws_init(struct brcmf_pub *drvr)
-{
- u32 tlv = 0;
- int rc;
-
- /* enable rssi signals */
- if (drvr->fw_signals)
- tlv = BRCMF_FWS_FLAGS_RSSI_SIGNALS |
- BRCMF_FWS_FLAGS_XONXOFF_SIGNALS |
- BRCMF_FWS_FLAGS_CREDIT_STATUS_SIGNALS;
-
- spin_lock_init(&drvr->fws_spinlock);
-
- drvr->fws = kzalloc(sizeof(*(drvr->fws)), GFP_KERNEL);
- if (!drvr->fws) {
- rc = -ENOMEM;
- goto fail;
- }
-
- /* set linkage back */
- drvr->fws->drvr = drvr;
- drvr->fws->fcmode = fcmode;
-
- /* enable proptxtstatus signaling by default */
- rc = brcmf_fil_iovar_int_set(drvr->iflist[0], "tlv", tlv);
- if (rc < 0) {
- brcmf_err("failed to set bdcv2 tlv signaling\n");
- goto fail;
- }
-
- if (brcmf_fweh_register(drvr, BRCMF_E_FIFO_CREDIT_MAP,
- brcmf_fws_notify_credit_map)) {
- brcmf_err("register credit map handler failed\n");
- goto fail;
- }
-
- brcmf_fws_hanger_init(&drvr->fws->hanger);
-
- /* create debugfs file for statistics */
- brcmf_debugfs_create_fws_stats(drvr, &drvr->fws->stats);
-
- /* TODO: remove upon feature delivery */
- brcmf_err("%s bdcv2 tlv signaling [%x]\n",
- drvr->fw_signals ? "enabled" : "disabled", tlv);
- return 0;
-
-fail:
- /* disable flow control entirely */
- drvr->fw_signals = false;
- brcmf_fws_deinit(drvr);
- return rc;
-}
-
-void brcmf_fws_deinit(struct brcmf_pub *drvr)
-{
- struct brcmf_fws_info *fws = drvr->fws;
- ulong flags;
-
- /* cleanup */
- brcmf_fws_lock(drvr, flags);
- brcmf_fws_cleanup(fws, -1);
- drvr->fws = NULL;
- brcmf_fws_unlock(drvr, flags);
-
- /* free top structure */
- kfree(fws);
-}
-
int brcmf_fws_hdrpull(struct brcmf_pub *drvr, int ifidx, s16 signal_len,
struct sk_buff *skb)
{
@@ -1287,6 +1219,74 @@ void brcmf_fws_del_interface(struct brcmf_if *ifp)
kfree(entry);
}
+int brcmf_fws_init(struct brcmf_pub *drvr)
+{
+ u32 tlv = 0;
+ int rc;
+
+ /* enable rssi signals */
+ if (drvr->fw_signals)
+ tlv = BRCMF_FWS_FLAGS_RSSI_SIGNALS |
+ BRCMF_FWS_FLAGS_XONXOFF_SIGNALS |
+ BRCMF_FWS_FLAGS_CREDIT_STATUS_SIGNALS;
+
+ spin_lock_init(&drvr->fws_spinlock);
+
+ drvr->fws = kzalloc(sizeof(*(drvr->fws)), GFP_KERNEL);
+ if (!drvr->fws) {
+ rc = -ENOMEM;
+ goto fail;
+ }
+
+ /* set linkage back */
+ drvr->fws->drvr = drvr;
+ drvr->fws->fcmode = fcmode;
+
+ /* enable proptxtstatus signaling by default */
+ rc = brcmf_fil_iovar_int_set(drvr->iflist[0], "tlv", tlv);
+ if (rc < 0) {
+ brcmf_err("failed to set bdcv2 tlv signaling\n");
+ goto fail;
+ }
+
+ if (brcmf_fweh_register(drvr, BRCMF_E_FIFO_CREDIT_MAP,
+ brcmf_fws_notify_credit_map)) {
+ brcmf_err("register credit map handler failed\n");
+ goto fail;
+ }
+
+ brcmf_fws_hanger_init(&drvr->fws->hanger);
+
+ /* create debugfs file for statistics */
+ brcmf_debugfs_create_fws_stats(drvr, &drvr->fws->stats);
+
+ /* TODO: remove upon feature delivery */
+ brcmf_err("%s bdcv2 tlv signaling [%x]\n",
+ drvr->fw_signals ? "enabled" : "disabled", tlv);
+ return 0;
+
+fail:
+ /* disable flow control entirely */
+ drvr->fw_signals = false;
+ brcmf_fws_deinit(drvr);
+ return rc;
+}
+
+void brcmf_fws_deinit(struct brcmf_pub *drvr)
+{
+ struct brcmf_fws_info *fws = drvr->fws;
+ ulong flags;
+
+ /* cleanup */
+ brcmf_fws_lock(drvr, flags);
+ brcmf_fws_cleanup(fws, -1);
+ drvr->fws = NULL;
+ brcmf_fws_unlock(drvr, flags);
+
+ /* free top structure */
+ kfree(fws);
+}
+
bool brcmf_fws_fc_active(struct brcmf_fws_info *fws)
{
if (!fws)