Merge branches 'irq-core-for-linus' and 'core-locking-for-linus' of git://git.kernel...
[pandora-kernel.git] / drivers / staging / brcm80211 / brcmfmac / dhd_linux.c
index e37ed4b..bbbe7c5 100644 (file)
 #ifdef CONFIG_WIFI_CONTROL_FUNC
 #include <linux/platform_device.h>
 #endif
-#include <typedefs.h>
-#include <linuxver.h>
-#include <osl.h>
-
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/kthread.h>
 #include <linux/ethtool.h>
 #include <linux/fcntl.h>
 #include <linux/fs.h>
-
 #include <linux/uaccess.h>
+#include <bcmdefs.h>
+#include <linuxver.h>
+#include <osl.h>
 #include <bcmutils.h>
 #include <bcmendian.h>
 
@@ -747,7 +745,7 @@ static void _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx)
                allmulti = cnt ? true : allmulti;
        }
 
-       MFREE(dhd->pub.osh, buf, buflen);
+       kfree(buf);
 
        /* Now send the allmulti setting.  This is based on the setting in the
         * net_device flags, but might be modified above to be turned on if we
@@ -768,7 +766,7 @@ static void _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx)
                DHD_ERROR(("%s: mkiovar failed for allmulti, datalen %d "
                        "buflen %u\n", dhd_ifname(&dhd->pub, ifidx),
                        (int)sizeof(allmulti), buflen));
-               MFREE(dhd->pub.osh, buf, buflen);
+               kfree(buf);
                return;
        }
 
@@ -784,7 +782,7 @@ static void _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx)
                           dhd_ifname(&dhd->pub, ifidx), ltoh32(allmulti)));
        }
 
-       MFREE(dhd->pub.osh, buf, buflen);
+       kfree(buf);
 
        /* Finally, pick up the PROMISC flag as well, like the NIC
                 driver does */
@@ -921,7 +919,7 @@ static void dhd_op_if(dhd_if_t *ifp)
                        free_netdev(ifp->net);
 
                dhd->iflist[ifp->idx] = NULL;
-               MFREE(dhd->pub.osh, ifp, sizeof(*ifp));
+               kfree(ifp);
 #ifdef SOFTAP
                if (ifp->net == ap_net_dev)
                        ap_net_dev = NULL;      /*  NULL  SOFTAP global
@@ -1041,10 +1039,6 @@ int dhd_sendpkt(dhd_pub_t *dhdp, int ifidx, void *pktbuf)
                        atomic_inc(&dhd->pend_8021x_cnt);
        }
 
-       /* Look into the packet and update the packet priority */
-       if ((PKTPRIO(pktbuf) == 0))
-               pktsetprio(pktbuf, false);
-
        /* If the protocol uses a data header, apply it */
        dhd_prot_hdrpush(dhdp, ifidx, pktbuf);
 
@@ -1746,7 +1740,7 @@ done:
        }
 
        if (buf)
-               MFREE(dhd->pub.osh, buf, buflen);
+               kfree(buf);
 
        return OSL_ERROR(bcmerror);
 }
@@ -1935,7 +1929,7 @@ dhd_pub_t *dhd_attach(osl_t *osh, struct dhd_bus *bus, uint bus_hdrlen)
                goto fail;
 
        net->netdev_ops = NULL;
-       init_MUTEX(&dhd->proto_sem);
+       sema_init(&dhd->proto_sem, 1);
        /* Initialize other structure content */
        init_waitqueue_head(&dhd->ioctl_resp_wait);
        init_waitqueue_head(&dhd->ctrl_wait);
@@ -1983,7 +1977,7 @@ dhd_pub_t *dhd_attach(osl_t *osh, struct dhd_bus *bus, uint bus_hdrlen)
        dhd->timer.function = dhd_watchdog;
 
        /* Initialize thread based operation and lock */
-       init_MUTEX(&dhd->sdsem);
+       sema_init(&dhd->sdsem, 1);
        if ((dhd_watchdog_prio >= 0) && (dhd_dpc_prio >= 0))
                dhd->threads_only = true;
        else
@@ -2374,8 +2368,8 @@ void dhd_detach(dhd_pub_t *dhdp)
                        WAKE_LOCK_DESTROY(dhdp, WAKE_LOCK_LINK_DOWN_TMOUT);
                        WAKE_LOCK_DESTROY(dhdp, WAKE_LOCK_PNO_FIND_TMOUT);
                        free_netdev(ifp->net);
-                       MFREE(dhd->pub.osh, ifp, sizeof(*ifp));
-                       MFREE(dhd->pub.osh, dhd, sizeof(*dhd));
+                       kfree(ifp);
+                       kfree(dhd);
                }
        }
 }
@@ -2923,7 +2917,7 @@ int write_to_file(dhd_pub_t *dhd, u8 *buf, int size)
 
 exit:
        /* free buf before return */
-       MFREE(dhd->osh, buf, size);
+       kfree(buf);
        /* close file before return */
        if (fp)
                filp_close(fp, current->files);