static s32 wl_event_handler(void *data);
static void wl_init_eq(struct wl_priv *wl);
static void wl_flush_eq(struct wl_priv *wl);
-static void wl_lock_eq(struct wl_priv *wl);
-static void wl_unlock_eq(struct wl_priv *wl);
+static unsigned long wl_lock_eq(struct wl_priv *wl);
+static void wl_unlock_eq(struct wl_priv *wl, unsigned long flags);
static void wl_init_eq_lock(struct wl_priv *wl);
static void wl_init_event_handler(struct wl_priv *wl);
static struct wl_event_q *wl_deq_event(struct wl_priv *wl);
static void wl_flush_eq(struct wl_priv *wl)
{
struct wl_event_q *e;
+ unsigned long flags;
- wl_lock_eq(wl);
+ flags = wl_lock_eq(wl);
while (!list_empty(&wl->eq_list)) {
e = list_first_entry(&wl->eq_list, struct wl_event_q, eq_list);
list_del(&e->eq_list);
kfree(e);
}
- wl_unlock_eq(wl);
+ wl_unlock_eq(wl, flags);
}
/*
static struct wl_event_q *wl_deq_event(struct wl_priv *wl)
{
struct wl_event_q *e = NULL;
+ unsigned long flags;
- wl_lock_eq(wl);
+ flags = wl_lock_eq(wl);
if (likely(!list_empty(&wl->eq_list))) {
e = list_first_entry(&wl->eq_list, struct wl_event_q, eq_list);
list_del(&e->eq_list);
}
- wl_unlock_eq(wl);
+ wl_unlock_eq(wl, flags);
return e;
}
s32 err = 0;
uint32 evtq_size;
uint32 data_len;
+ unsigned long flags;
+ gfp_t aflags;
data_len = 0;
if (data)
data_len = ntoh32(msg->datalen);
evtq_size = sizeof(struct wl_event_q) + data_len;
- e = kzalloc(evtq_size, GFP_ATOMIC);
+ aflags = (in_atomic()) ? GFP_ATOMIC : GFP_KERNEL;
+ e = kzalloc(evtq_size, aflags);
if (unlikely(!e)) {
WL_ERR(("event alloc failed\n"));
return -ENOMEM;
memcpy(&e->emsg, msg, sizeof(wl_event_msg_t));
if (data)
memcpy(e->edata, data, data_len);
- wl_lock_eq(wl);
+ flags = wl_lock_eq(wl);
list_add_tail(&e->eq_list, &wl->eq_list);
- wl_unlock_eq(wl);
+ wl_unlock_eq(wl, flags);
return err;
}
conn_info->resp_ie_len = 0;
}
-static void wl_lock_eq(struct wl_priv *wl)
+static unsigned long wl_lock_eq(struct wl_priv *wl)
{
- spin_lock_irq(&wl->eq_lock);
+ unsigned long flags;
+
+ spin_lock_irqsave(&wl->eq_lock, flags);
+ return flags;
}
-static void wl_unlock_eq(struct wl_priv *wl)
+static void wl_unlock_eq(struct wl_priv *wl, unsigned long flags)
{
- spin_unlock_irq(&wl->eq_lock);
+ spin_unlock_irqrestore(&wl->eq_lock, flags);
}
static void wl_init_eq_lock(struct wl_priv *wl)