staging: brcm80211: remove include file sbhndpio.h
[firefly-linux-kernel-4.4.55.git] / drivers / staging / brcm80211 / brcmsmac / wl_mac80211.c
index 98ceaed1700de7ad5732af750bc8982a60bad041..137a382bac52b3d23ddd3c2087a9fe383d3c6dad 100644 (file)
 
 #include <linux/kernel.h>
 #include <linux/etherdevice.h>
-#include <linux/string.h>
+#include <linux/types.h>
 #include <linux/pci_ids.h>
-#include <bcmdefs.h>
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/sched.h>
-#include <osl.h>
-#define WLC_MAXBSSCFG          1       /* single BSS configs */
-
-#include <wlc_cfg.h>
+#include <linux/firmware.h>
 #include <net/mac80211.h>
-#include <phy_version.h>
+
+#include <proto/802.11.h>
+#include <osl.h>
+#include <bcmdefs.h>
+#include <bcmwifi.h>
 #include <bcmutils.h>
 #include <pcicfg.h>
 #include <wlioctl.h>
-#include <wlc_key.h>
-#include <sbhndpio.h>
 #include <sbhnddma.h>
-#include <wlc_channel.h>
-#include <wlc_pub.h>
-#include <wlc_scb.h>
-#include <wl_dbg.h>
-#include <wl_export.h>
-
-#include <wl_mac80211.h>
-#include <linux/firmware.h>
-#include <wl_ucode.h>
-#include <d11ucode_ext.h>
 
+#include "phy/wlc_phy_int.h"
+#include "d11.h"
+#include "wlc_types.h"
+#include "wlc_cfg.h"
+#include "phy/phy_version.h"
+#include "wlc_key.h"
+#include "wlc_channel.h"
+#include "wlc_scb.h"
+#include "wlc_pub.h"
+#include "wl_dbg.h"
+#include "wl_export.h"
+#include "wl_ucode.h"
+#include "d11ucode_ext.h"
+#include "wl_mac80211.h"
 
 static void wl_timer(unsigned long data);
-static void _wl_timer(wl_timer_t *t);
+static void _wl_timer(struct wl_timer *t);
 
 
 static int ieee_hw_init(struct ieee80211_hw *hw);
@@ -78,6 +80,12 @@ static int wl_start(struct sk_buff *skb, struct wl_info *wl);
 static int wl_start_int(struct wl_info *wl, struct ieee80211_hw *hw,
                        struct sk_buff *skb);
 static void wl_dpc(unsigned long data);
+static irqreturn_t wl_isr(int irq, void *dev_id);
+
+static int __devinit wl_pci_probe(struct pci_dev *pdev,
+                                 const struct pci_device_id *ent);
+static void wl_remove(struct pci_dev *pdev);
+static void wl_free(struct wl_info *wl);
 
 MODULE_AUTHOR("Broadcom Corporation");
 MODULE_DESCRIPTION("Broadcom 802.11n wireless LAN driver.");
@@ -93,8 +101,6 @@ static struct pci_device_id wl_id_table[] = {
 };
 
 MODULE_DEVICE_TABLE(pci, wl_id_table);
-static void wl_remove(struct pci_dev *pdev);
-
 
 #ifdef BCMDBG
 static int msglevel = 0xdeadbeef;
@@ -105,6 +111,8 @@ module_param(phymsglevel, int, 0);
 
 #define HW_TO_WL(hw)    (hw->priv)
 #define WL_TO_HW(wl)     (wl->pub->ieee_hw)
+
+/* MAC80211 callback functions */
 static int wl_ops_tx(struct ieee80211_hw *hw, struct sk_buff *skb);
 static int wl_ops_start(struct ieee80211_hw *hw);
 static void wl_ops_stop(struct ieee80211_hw *hw);
@@ -1096,7 +1104,7 @@ static int ieee_hw_init(struct ieee80211_hw *hw)
  *
  * Perimeter lock is initialized in the course of this function.
  */
-int __devinit
+static int __devinit
 wl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
        int rc;
@@ -1334,9 +1342,9 @@ module_exit(wl_module_exit);
  * precondition: can both be called locked and unlocked
  *
  */
-void wl_free(struct wl_info *wl)
+static void wl_free(struct wl_info *wl)
 {
-       wl_timer_t *t, *next;
+       struct wl_timer *t, *next;
        struct osl_info *osh;
 
        ASSERT(wl);
@@ -1525,7 +1533,7 @@ void wl_down(struct wl_info *wl)
        WL_LOCK(wl);
 }
 
-irqreturn_t BCMFASTPATH wl_isr(int irq, void *dev_id)
+static irqreturn_t BCMFASTPATH wl_isr(int irq, void *dev_id)
 {
        struct wl_info *wl;
        bool ours, wantdpc;
@@ -1590,47 +1598,18 @@ static void BCMFASTPATH wl_dpc(unsigned long data)
        WL_UNLOCK(wl);
 }
 
-static void wl_link_up(struct wl_info *wl, char *ifname)
-{
-       WL_NONE("wl%d: link up (%s)\n", wl->pub->unit, ifname);
-}
-
-static void wl_link_down(struct wl_info *wl, char *ifname)
-{
-       WL_NONE("wl%d: link down (%s)\n", wl->pub->unit, ifname);
-}
-
-/*
- * precondition: perimeter lock has been acquired
- */
-void wl_event(struct wl_info *wl, char *ifname, wlc_event_t *e)
-{
-
-       switch (e->event.event_type) {
-       case WLC_E_LINK:
-       case WLC_E_NDIS_LINK:
-               if (e->event.flags & WLC_EVENT_MSG_LINK)
-                       wl_link_up(wl, ifname);
-               else
-                       wl_link_down(wl, ifname);
-               break;
-       case WLC_E_RADIO:
-               break;
-       }
-}
-
 /*
  * is called by the kernel from software irq context
  */
 static void wl_timer(unsigned long data)
 {
-       _wl_timer((wl_timer_t *) data);
+       _wl_timer((struct wl_timer *) data);
 }
 
 /*
 * precondition: perimeter lock is not acquired
  */
-static void _wl_timer(wl_timer_t *t)
+static void _wl_timer(struct wl_timer *t)
 {
        WL_LOCK(t->wl);
 
@@ -1657,18 +1636,18 @@ static void _wl_timer(wl_timer_t *t)
  *
  * precondition: perimeter lock has been acquired
  */
-wl_timer_t *wl_init_timer(struct wl_info *wl, void (*fn) (void *arg), void *arg,
-                         const char *name)
+struct wl_timer *wl_init_timer(struct wl_info *wl, void (*fn) (void *arg),
+                              void *arg, const char *name)
 {
-       wl_timer_t *t;
+       struct wl_timer *t;
 
-       t = kmalloc(sizeof(wl_timer_t), GFP_ATOMIC);
+       t = kmalloc(sizeof(struct wl_timer), GFP_ATOMIC);
        if (!t) {
                WL_ERROR("wl%d: wl_init_timer: out of memory\n", wl->pub->unit);
                return 0;
        }
 
-       memset(t, 0, sizeof(wl_timer_t));
+       memset(t, 0, sizeof(struct wl_timer));
 
        init_timer(&t->timer);
        t->timer.data = (unsigned long) t;
@@ -1693,7 +1672,7 @@ wl_timer_t *wl_init_timer(struct wl_info *wl, void (*fn) (void *arg), void *arg,
  *
  * precondition: perimeter lock has been acquired
  */
-void wl_add_timer(struct wl_info *wl, wl_timer_t *t, uint ms, int periodic)
+void wl_add_timer(struct wl_info *wl, struct wl_timer *t, uint ms, int periodic)
 {
 #ifdef BCMDBG
        if (t->set) {
@@ -1717,7 +1696,7 @@ void wl_add_timer(struct wl_info *wl, wl_timer_t *t, uint ms, int periodic)
  *
  * precondition: perimeter lock has been acquired
  */
-bool wl_del_timer(struct wl_info *wl, wl_timer_t *t)
+bool wl_del_timer(struct wl_info *wl, struct wl_timer *t)
 {
        if (t->set) {
                t->set = false;
@@ -1733,9 +1712,9 @@ bool wl_del_timer(struct wl_info *wl, wl_timer_t *t)
 /*
  * precondition: perimeter lock has been acquired
  */
-void wl_free_timer(struct wl_info *wl, wl_timer_t *t)
+void wl_free_timer(struct wl_info *wl, struct wl_timer *t)
 {
-       wl_timer_t *tmp;
+       struct wl_timer *tmp;
 
        /* delete the timer in case it is active */
        wl_del_timer(wl, t);