Lines Matching refs:wl
58 static int wl1271_tm_cmd_test(struct wl1271 *wl, struct nlattr *tb[]) in wl1271_tm_cmd_test() argument
79 mutex_lock(&wl->mutex); in wl1271_tm_cmd_test()
81 if (unlikely(wl->state != WLCORE_STATE_ON)) { in wl1271_tm_cmd_test()
86 ret = pm_runtime_resume_and_get(wl->dev); in wl1271_tm_cmd_test()
90 ret = wl1271_cmd_test(wl, buf, buf_len, answer); in wl1271_tm_cmd_test()
112 skb = cfg80211_testmode_alloc_reply_skb(wl->hw->wiphy, len); in wl1271_tm_cmd_test()
130 pm_runtime_mark_last_busy(wl->dev); in wl1271_tm_cmd_test()
131 pm_runtime_put_autosuspend(wl->dev); in wl1271_tm_cmd_test()
133 mutex_unlock(&wl->mutex); in wl1271_tm_cmd_test()
138 static int wl1271_tm_cmd_interrogate(struct wl1271 *wl, struct nlattr *tb[]) in wl1271_tm_cmd_interrogate() argument
152 mutex_lock(&wl->mutex); in wl1271_tm_cmd_interrogate()
154 if (unlikely(wl->state != WLCORE_STATE_ON)) { in wl1271_tm_cmd_interrogate()
159 ret = pm_runtime_resume_and_get(wl->dev); in wl1271_tm_cmd_interrogate()
169 ret = wl1271_cmd_interrogate(wl, ie_id, cmd, in wl1271_tm_cmd_interrogate()
176 skb = cfg80211_testmode_alloc_reply_skb(wl->hw->wiphy, sizeof(*cmd)); in wl1271_tm_cmd_interrogate()
195 pm_runtime_mark_last_busy(wl->dev); in wl1271_tm_cmd_interrogate()
196 pm_runtime_put_autosuspend(wl->dev); in wl1271_tm_cmd_interrogate()
198 mutex_unlock(&wl->mutex); in wl1271_tm_cmd_interrogate()
203 static int wl1271_tm_cmd_configure(struct wl1271 *wl, struct nlattr *tb[]) in wl1271_tm_cmd_configure() argument
223 mutex_lock(&wl->mutex); in wl1271_tm_cmd_configure()
224 ret = wl1271_cmd_configure(wl, ie_id, buf, buf_len); in wl1271_tm_cmd_configure()
225 mutex_unlock(&wl->mutex); in wl1271_tm_cmd_configure()
235 static int wl1271_tm_detect_fem(struct wl1271 *wl, struct nlattr *tb[]) in wl1271_tm_detect_fem() argument
241 ret = wl1271_plt_start(wl, PLT_FEM_DETECT); in wl1271_tm_detect_fem()
245 mutex_lock(&wl->mutex); in wl1271_tm_detect_fem()
247 len = nla_total_size(sizeof(wl->fem_manuf)); in wl1271_tm_detect_fem()
248 skb = cfg80211_testmode_alloc_reply_skb(wl->hw->wiphy, len); in wl1271_tm_detect_fem()
254 if (nla_put(skb, WL1271_TM_ATTR_DATA, sizeof(wl->fem_manuf), in wl1271_tm_detect_fem()
255 &wl->fem_manuf)) { in wl1271_tm_detect_fem()
264 mutex_unlock(&wl->mutex); in wl1271_tm_detect_fem()
267 wl1271_plt_stop(wl); in wl1271_tm_detect_fem()
272 static int wl1271_tm_cmd_set_plt_mode(struct wl1271 *wl, struct nlattr *tb[]) in wl1271_tm_cmd_set_plt_mode() argument
286 ret = wl1271_plt_stop(wl); in wl1271_tm_cmd_set_plt_mode()
290 ret = wl1271_plt_start(wl, val); in wl1271_tm_cmd_set_plt_mode()
293 ret = wl1271_tm_detect_fem(wl, tb); in wl1271_tm_cmd_set_plt_mode()
303 static int wl12xx_tm_cmd_get_mac(struct wl1271 *wl, struct nlattr *tb[]) in wl12xx_tm_cmd_get_mac() argument
309 mutex_lock(&wl->mutex); in wl12xx_tm_cmd_get_mac()
311 if (!wl->plt) { in wl12xx_tm_cmd_get_mac()
316 if (wl->fuse_oui_addr == 0 && wl->fuse_nic_addr == 0) { in wl12xx_tm_cmd_get_mac()
321 mac_addr[0] = (u8)(wl->fuse_oui_addr >> 16); in wl12xx_tm_cmd_get_mac()
322 mac_addr[1] = (u8)(wl->fuse_oui_addr >> 8); in wl12xx_tm_cmd_get_mac()
323 mac_addr[2] = (u8) wl->fuse_oui_addr; in wl12xx_tm_cmd_get_mac()
324 mac_addr[3] = (u8)(wl->fuse_nic_addr >> 16); in wl12xx_tm_cmd_get_mac()
325 mac_addr[4] = (u8)(wl->fuse_nic_addr >> 8); in wl12xx_tm_cmd_get_mac()
326 mac_addr[5] = (u8) wl->fuse_nic_addr; in wl12xx_tm_cmd_get_mac()
328 skb = cfg80211_testmode_alloc_reply_skb(wl->hw->wiphy, ETH_ALEN); in wl12xx_tm_cmd_get_mac()
345 mutex_unlock(&wl->mutex); in wl12xx_tm_cmd_get_mac()
352 struct wl1271 *wl = hw->priv; in wl1271_tm_cmd() local
368 if (wl->plt_mode == PLT_CHIP_AWAKE && in wl1271_tm_cmd()
374 return wl1271_tm_cmd_test(wl, tb); in wl1271_tm_cmd()
376 return wl1271_tm_cmd_interrogate(wl, tb); in wl1271_tm_cmd()
378 return wl1271_tm_cmd_configure(wl, tb); in wl1271_tm_cmd()
380 return wl1271_tm_cmd_set_plt_mode(wl, tb); in wl1271_tm_cmd()
382 return wl12xx_tm_cmd_get_mac(wl, tb); in wl1271_tm_cmd()