X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=blobdiff_plain;f=drivers%2Fstaging%2Fbrcm80211%2Fbrcmfmac%2Fdhd_linux.c;h=bbbe7c5f7492573508d5027b03cd1df9a187b561;hp=e37ed4b13340f454175cd97d707cae3f452d288b;hb=82279e6bd7643da1b3fbda42555c3238c7b00d38;hpb=5fcc1fcb2ec18094b3a8022b1974c0b2e9f5f73c diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c index e37ed4b13340..bbbe7c5f7492 100644 --- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c +++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c @@ -17,10 +17,6 @@ #ifdef CONFIG_WIFI_CONTROL_FUNC #include #endif -#include -#include -#include - #include #include #include @@ -34,8 +30,10 @@ #include #include #include - #include +#include +#include +#include #include #include @@ -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);