* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <typedefs.h>
-#include <osl.h>
#include <linux/kernel.h>
#include <linux/string.h>
+#include <bcmdefs.h>
+#include <linux/netdevice.h>
+#include <osl.h>
#include <bcmutils.h>
#include <bcmendian.h>
#include <dngl_stats.h>
}
}
-bool dhd_prec_enq(dhd_pub_t *dhdp, struct pktq *q, void *pkt, int prec)
+bool dhd_prec_enq(dhd_pub_t *dhdp, struct pktq *q, struct sk_buff *pkt,
+ int prec)
{
- void *p;
+ struct sk_buff *p;
int eprec = -1; /* precedence to evict from */
bool discard_oldest;
*/
if (!pktq_pfull(q, prec) && !pktq_full(q)) {
pktq_penq(q, prec, pkt);
- return TRUE;
+ return true;
}
/* Determine precedence from which to evict packet, if any */
p = pktq_peek_tail(q, &eprec);
ASSERT(p);
if (eprec > prec)
- return FALSE;
+ return false;
}
/* Evict if needed */
ASSERT(!pktq_pempty(q, eprec));
discard_oldest = AC_BITMAP_TST(dhdp->wme_dp, eprec);
if (eprec == prec && !discard_oldest)
- return FALSE; /* refuse newer (incoming) packet */
+ return false; /* refuse newer (incoming) packet */
/* Evict packet according to discard policy */
p = discard_oldest ? pktq_pdeq(q, eprec) : pktq_pdeq_tail(q,
eprec);
ASSERT(p);
}
- PKTFREE(dhdp->osh, p, TRUE);
+ PKTFREE(dhdp->osh, p, true);
}
/* Enqueue */
ASSERT(p);
}
- return TRUE;
+ return true;
}
static int
static void wl_show_host_event(wl_event_msg_t *event, void *event_data)
{
uint i, status, reason;
- bool group = FALSE, flush_txq = FALSE, link = FALSE;
+ bool group = false, flush_txq = false, link = false;
char *auth_str, *event_name;
unsigned char *buf;
char err_msg[256], eabuf[ETHER_ADDR_STR_LEN];
DHD_EVENT(("EVENT: %s, event ID = %d\n", event_name, event_type));
if (flags & WLC_EVENT_MSG_LINK)
- link = TRUE;
+ link = true;
if (flags & WLC_EVENT_MSG_GROUP)
- group = TRUE;
+ group = true;
if (flags & WLC_EVENT_MSG_FLUSHTXQ)
- flush_txq = TRUE;
+ flush_txq = true;
switch (event_type) {
case WLC_E_START:
wl_pkt_filter_enable_t enable_parm;
wl_pkt_filter_enable_t *pkt_filterp;
- arg_save = MALLOC(dhd->osh, strlen(arg) + 1);
+ arg_save = kmalloc(strlen(arg) + 1, GFP_ATOMIC);
if (!arg_save) {
DHD_ERROR(("%s: kmalloc failed\n", __func__));
goto fail;
fail:
if (arg_org)
- MFREE(dhd->osh, arg_org, strlen(arg) + 1);
+ kfree(arg_org);
}
void dhd_pktfilter_offload_set(dhd_pub_t *dhd, char *arg)
char *arg_save = 0, *arg_org = 0;
#define BUF_SIZE 2048
- arg_save = MALLOC(dhd->osh, strlen(arg) + 1);
+ arg_save = kmalloc(strlen(arg) + 1, GFP_ATOMIC);
if (!arg_save) {
DHD_ERROR(("%s: kmalloc failed\n", __func__));
goto fail;
arg_org = arg_save;
- buf = MALLOC(dhd->osh, BUF_SIZE);
+ buf = kmalloc(BUF_SIZE, GFP_ATOMIC);
if (!buf) {
DHD_ERROR(("%s: kmalloc failed\n", __func__));
goto fail;
fail:
if (arg_org)
- MFREE(dhd->osh, arg_org, strlen(arg) + 1);
+ kfree(arg_org);
if (buf)
- MFREE(dhd->osh, buf, BUF_SIZE);
+ kfree(buf);
}
void dhd_arp_offload_set(dhd_pub_t *dhd, int arp_mode)
dhd_iscan_lock();
- iscanbuf_alloc = (iscan_buf_t *) MALLOC(dhd->osh, sizeof(iscan_buf_t));
+ iscanbuf_alloc = kmalloc(sizeof(iscan_buf_t), GFP_ATOMIC);
if (iscanbuf_alloc == NULL)
goto fail;
iscanbuf_free = iscanbuf_cur;
iscanbuf_cur = iscanbuf_cur->next;
iscanbuf_free->next = 0;
- MFREE(dhd->osh, iscanbuf_free, sizeof(iscan_buf_t));
+ kfree(iscanbuf_free);
}
iscan_chain = 0;
} else {
iscanbuf_prv->next = iscan_delete->next;
iscan_delete->next = 0;
- MFREE(dhd->osh, iscan_delete, sizeof(iscan_buf_t));
+ kfree(iscan_delete);
if (!iscanbuf_prv)
iscan_chain = 0;
bi->BSSID.octet[2], bi->BSSID.octet[3],
bi->BSSID.octet[4], bi->BSSID.octet[5]));
- bi = (wl_bss_info_t *) ((uintptr) bi +
+ bi = (wl_bss_info_t *)((unsigned long)bi +
dtoh32(bi->length));
}
iscan_cur = iscan_cur->next;
bi->BSSID.octet[5]));
bi_new = bi;
- bi = (wl_bss_info_t *) ((uintptr) bi +
+ bi = (wl_bss_info_t *)((unsigned long)bi +
dtoh32
(bi->length));
/*
bi->BSSID.octet[5]));
bi_next =
- (wl_bss_info_t
- *) ((uintptr) bi +
+ (wl_bss_info_t *)((unsigned long)bi +
dtoh32
(bi->length));
bcopy(bi, bi_new,
dtoh32
(bi->length));
bi_new =
- (wl_bss_info_t
- *) ((uintptr)
- bi_new +
+ (wl_bss_info_t *)((unsigned long)bi_new +
dtoh32
(bi_new->
length));
}
break;
}
- bi = (wl_bss_info_t *) ((uintptr) bi +
+ bi = (wl_bss_info_t *)((unsigned long)bi +
dtoh32(bi->length));
}
}
dhd_iscan_delete_bss(dhdp, bi->BSSID.octet, iscan_cur);
- bi = (wl_bss_info_t *) ((uintptr) bi + dtoh32(bi->length));
+ bi = (wl_bss_info_t *)((unsigned long)bi + dtoh32(bi->length));
}
done: