diff options
author | Ajay Singh <ajay.kathat@microchip.com> | 2018-12-02 18:02:51 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-12-05 09:49:44 +0100 |
commit | 147ccfd451024de2785d678863a6a6889cb2db60 (patch) | |
tree | df22e1dea3faaecee48a1a8930ed3be9de752e12 /drivers/staging/wilc1000 | |
parent | 976c89b5625d12d5a58bc375a18f66472e1c9867 (diff) |
staging: wilc1000: handle mgmt_frame_register ops from cfg82011 context
Avoid handling of mgmt_frame_register operation callback in a deferred
manner. Now set the wid command to firmware directly from caller
context.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wilc1000')
-rw-r--r-- | drivers/staging/wilc1000/host_interface.c | 70 | ||||
-rw-r--r-- | drivers/staging/wilc1000/host_interface.h | 6 |
2 files changed, 22 insertions, 54 deletions
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 97b84d2c45f2..4d1fa4a773ad 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -89,6 +89,12 @@ struct del_all_sta { u8 mac[WILC_MAX_NUM_STA][ETH_ALEN]; }; +struct wilc_reg_frame { + bool reg; + u8 reg_id; + __le32 frame_type; +} __packed; + struct set_ip_addr { u8 *ip_addr; u8 idx; @@ -115,7 +121,6 @@ union message_body { struct get_mac_addr get_mac_info; struct ba_session_info session_info; struct remain_ch remain_on_ch; - struct reg_frame reg_frame; char *data; }; @@ -1963,39 +1968,6 @@ error: return result; } -static void handle_register_frame(struct work_struct *work) -{ - struct host_if_msg *msg = container_of(work, struct host_if_msg, work); - struct wilc_vif *vif = msg->vif; - struct reg_frame *hif_reg_frame = &msg->body.reg_frame; - int result; - struct wid wid; - u8 *cur_byte; - - wid.id = WID_REGISTER_FRAME; - wid.type = WID_STR; - wid.val = kmalloc(sizeof(u16) + 2, GFP_KERNEL); - if (!wid.val) - goto out; - - cur_byte = wid.val; - - *cur_byte++ = hif_reg_frame->reg; - *cur_byte++ = hif_reg_frame->reg_id; - memcpy(cur_byte, &hif_reg_frame->frame_type, sizeof(u16)); - - wid.size = sizeof(u16) + 2; - - result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1, - wilc_get_vif_idx(vif)); - kfree(wid.val); - if (result) - netdev_err(vif->ndev, "Failed to frame register\n"); - -out: - kfree(msg); -} - static void handle_listen_state_expired(struct work_struct *work) { struct host_if_msg *msg = container_of(work, struct host_if_msg, work); @@ -3162,33 +3134,35 @@ int wilc_listen_state_expired(struct wilc_vif *vif, u32 session_id) void wilc_frame_register(struct wilc_vif *vif, u16 frame_type, bool reg) { + struct wid wid; int result; - struct host_if_msg *msg; + struct wilc_reg_frame reg_frame; - msg = wilc_alloc_work(vif, handle_register_frame, false); - if (IS_ERR(msg)) - return; + wid.id = WID_REGISTER_FRAME; + wid.type = WID_STR; + wid.size = sizeof(reg_frame); + wid.val = (u8 *)®_frame; + + memset(®_frame, 0x0, sizeof(reg_frame)); + reg_frame.reg = reg; switch (frame_type) { case IEEE80211_STYPE_ACTION: - msg->body.reg_frame.reg_id = WILC_FW_ACTION_FRM_IDX; + reg_frame.reg_id = WILC_FW_ACTION_FRM_IDX; break; case IEEE80211_STYPE_PROBE_REQ: - msg->body.reg_frame.reg_id = WILC_FW_PROBE_REQ_IDX; + reg_frame.reg_id = WILC_FW_PROBE_REQ_IDX; break; default: break; } - msg->body.reg_frame.frame_type = frame_type; - msg->body.reg_frame.reg = reg; - - result = wilc_enqueue_work(msg); - if (result) { - netdev_err(vif->ndev, "%s: enqueue work failed\n", __func__); - kfree(msg); - } + reg_frame.frame_type = cpu_to_le16(frame_type); + result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1, + wilc_get_vif_idx(vif)); + if (result) + netdev_err(vif->ndev, "Failed to frame register\n"); } int wilc_add_beacon(struct wilc_vif *vif, u32 interval, u32 dtim_period, diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 647a1afcd186..10d5627b22bf 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -244,12 +244,6 @@ struct remain_ch { u32 id; }; -struct reg_frame { - bool reg; - u16 frame_type; - u8 reg_id; -}; - struct wilc; struct host_if_drv { struct user_scan_req usr_scan_req; |