time-event.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527
  1. /******************************************************************************
  2. *
  3. * This file is provided under a dual BSD/GPLv2 license. When using or
  4. * redistributing this file, you may do so under either license.
  5. *
  6. * GPL LICENSE SUMMARY
  7. *
  8. * Copyright(c) 2012 - 2013 Intel Corporation. All rights reserved.
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of version 2 of the GNU General Public License as
  12. * published by the Free Software Foundation.
  13. *
  14. * This program is distributed in the hope that it will be useful, but
  15. * WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
  22. * USA
  23. *
  24. * The full GNU General Public License is included in this distribution
  25. * in the file called COPYING.
  26. *
  27. * Contact Information:
  28. * Intel Linux Wireless <ilw@linux.intel.com>
  29. * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  30. *
  31. * BSD LICENSE
  32. *
  33. * Copyright(c) 2012 - 2013 Intel Corporation. All rights reserved.
  34. * All rights reserved.
  35. *
  36. * Redistribution and use in source and binary forms, with or without
  37. * modification, are permitted provided that the following conditions
  38. * are met:
  39. *
  40. * * Redistributions of source code must retain the above copyright
  41. * notice, this list of conditions and the following disclaimer.
  42. * * Redistributions in binary form must reproduce the above copyright
  43. * notice, this list of conditions and the following disclaimer in
  44. * the documentation and/or other materials provided with the
  45. * distribution.
  46. * * Neither the name Intel Corporation nor the names of its
  47. * contributors may be used to endorse or promote products derived
  48. * from this software without specific prior written permission.
  49. *
  50. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  51. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  52. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  53. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  54. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  55. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  56. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  57. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  58. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  59. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  60. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  61. *
  62. *****************************************************************************/
  63. #include <linux/jiffies.h>
  64. #include <net/mac80211.h>
  65. #include "iwl-notif-wait.h"
  66. #include "iwl-trans.h"
  67. #include "fw-api.h"
  68. #include "time-event.h"
  69. #include "mvm.h"
  70. #include "iwl-io.h"
  71. #include "iwl-prph.h"
  72. /* A TimeUnit is 1024 microsecond */
  73. #define TU_TO_JIFFIES(_tu) (usecs_to_jiffies((_tu) * 1024))
  74. #define MSEC_TO_TU(_msec) (_msec*1000/1024)
  75. /*
  76. * For the high priority TE use a time event type that has similar priority to
  77. * the FW's action scan priority.
  78. */
  79. #define IWL_MVM_ROC_TE_TYPE_NORMAL TE_P2P_DEVICE_DISCOVERABLE
  80. #define IWL_MVM_ROC_TE_TYPE_MGMT_TX TE_P2P_CLIENT_ASSOC
  81. void iwl_mvm_te_clear_data(struct iwl_mvm *mvm,
  82. struct iwl_mvm_time_event_data *te_data)
  83. {
  84. lockdep_assert_held(&mvm->time_event_lock);
  85. if (te_data->id == TE_MAX)
  86. return;
  87. list_del(&te_data->list);
  88. te_data->running = false;
  89. te_data->uid = 0;
  90. te_data->id = TE_MAX;
  91. te_data->vif = NULL;
  92. }
  93. void iwl_mvm_roc_done_wk(struct work_struct *wk)
  94. {
  95. struct iwl_mvm *mvm = container_of(wk, struct iwl_mvm, roc_done_wk);
  96. synchronize_net();
  97. /*
  98. * Flush the offchannel queue -- this is called when the time
  99. * event finishes or is cancelled, so that frames queued for it
  100. * won't get stuck on the queue and be transmitted in the next
  101. * time event.
  102. * We have to send the command asynchronously since this cannot
  103. * be under the mutex for locking reasons, but that's not an
  104. * issue as it will have to complete before the next command is
  105. * executed, and a new time event means a new command.
  106. */
  107. iwl_mvm_flush_tx_path(mvm, BIT(IWL_MVM_OFFCHANNEL_QUEUE), false);
  108. }
  109. static void iwl_mvm_roc_finished(struct iwl_mvm *mvm)
  110. {
  111. /*
  112. * First, clear the ROC_RUNNING status bit. This will cause the TX
  113. * path to drop offchannel transmissions. That would also be done
  114. * by mac80211, but it is racy, in particular in the case that the
  115. * time event actually completed in the firmware (which is handled
  116. * in iwl_mvm_te_handle_notif).
  117. */
  118. clear_bit(IWL_MVM_STATUS_ROC_RUNNING, &mvm->status);
  119. /*
  120. * Of course, our status bit is just as racy as mac80211, so in
  121. * addition, fire off the work struct which will drop all frames
  122. * from the hardware queues that made it through the race. First
  123. * it will of course synchronize the TX path to make sure that
  124. * any *new* TX will be rejected.
  125. */
  126. schedule_work(&mvm->roc_done_wk);
  127. }
  128. /*
  129. * Handles a FW notification for an event that is known to the driver.
  130. *
  131. * @mvm: the mvm component
  132. * @te_data: the time event data
  133. * @notif: the notification data corresponding the time event data.
  134. */
  135. static void iwl_mvm_te_handle_notif(struct iwl_mvm *mvm,
  136. struct iwl_mvm_time_event_data *te_data,
  137. struct iwl_time_event_notif *notif)
  138. {
  139. lockdep_assert_held(&mvm->time_event_lock);
  140. IWL_DEBUG_TE(mvm, "Handle time event notif - UID = 0x%x action %d\n",
  141. le32_to_cpu(notif->unique_id),
  142. le32_to_cpu(notif->action));
  143. /*
  144. * The FW sends the start/end time event notifications even for events
  145. * that it fails to schedule. This is indicated in the status field of
  146. * the notification. This happens in cases that the scheduler cannot
  147. * find a schedule that can handle the event (for example requesting a
  148. * P2P Device discoveribility, while there are other higher priority
  149. * events in the system).
  150. */
  151. WARN_ONCE(!le32_to_cpu(notif->status),
  152. "Failed to schedule time event\n");
  153. if (le32_to_cpu(notif->action) & TE_NOTIF_HOST_EVENT_END) {
  154. IWL_DEBUG_TE(mvm,
  155. "TE ended - current time %lu, estimated end %lu\n",
  156. jiffies, te_data->end_jiffies);
  157. if (te_data->vif->type == NL80211_IFTYPE_P2P_DEVICE) {
  158. ieee80211_remain_on_channel_expired(mvm->hw);
  159. iwl_mvm_roc_finished(mvm);
  160. }
  161. /*
  162. * By now, we should have finished association
  163. * and know the dtim period.
  164. */
  165. if (te_data->vif->type == NL80211_IFTYPE_STATION &&
  166. (!te_data->vif->bss_conf.assoc ||
  167. !te_data->vif->bss_conf.dtim_period)) {
  168. IWL_ERR(mvm,
  169. "No assocation and the time event is over already...\n");
  170. ieee80211_connection_loss(te_data->vif);
  171. }
  172. iwl_mvm_te_clear_data(mvm, te_data);
  173. } else if (le32_to_cpu(notif->action) & TE_NOTIF_HOST_EVENT_START) {
  174. te_data->running = true;
  175. te_data->end_jiffies = jiffies +
  176. TU_TO_JIFFIES(te_data->duration);
  177. if (te_data->vif->type == NL80211_IFTYPE_P2P_DEVICE) {
  178. set_bit(IWL_MVM_STATUS_ROC_RUNNING, &mvm->status);
  179. ieee80211_ready_on_channel(mvm->hw);
  180. }
  181. } else {
  182. IWL_WARN(mvm, "Got TE with unknown action\n");
  183. }
  184. }
  185. /*
  186. * The Rx handler for time event notifications
  187. */
  188. int iwl_mvm_rx_time_event_notif(struct iwl_mvm *mvm,
  189. struct iwl_rx_cmd_buffer *rxb,
  190. struct iwl_device_cmd *cmd)
  191. {
  192. struct iwl_rx_packet *pkt = rxb_addr(rxb);
  193. struct iwl_time_event_notif *notif = (void *)pkt->data;
  194. struct iwl_mvm_time_event_data *te_data, *tmp;
  195. IWL_DEBUG_TE(mvm, "Time event notification - UID = 0x%x action %d\n",
  196. le32_to_cpu(notif->unique_id),
  197. le32_to_cpu(notif->action));
  198. spin_lock_bh(&mvm->time_event_lock);
  199. list_for_each_entry_safe(te_data, tmp, &mvm->time_event_list, list) {
  200. if (le32_to_cpu(notif->unique_id) == te_data->uid)
  201. iwl_mvm_te_handle_notif(mvm, te_data, notif);
  202. }
  203. spin_unlock_bh(&mvm->time_event_lock);
  204. return 0;
  205. }
  206. static bool iwl_mvm_time_event_response(struct iwl_notif_wait_data *notif_wait,
  207. struct iwl_rx_packet *pkt, void *data)
  208. {
  209. struct iwl_mvm *mvm =
  210. container_of(notif_wait, struct iwl_mvm, notif_wait);
  211. struct iwl_mvm_time_event_data *te_data = data;
  212. struct iwl_time_event_resp *resp;
  213. int resp_len = le32_to_cpu(pkt->len_n_flags) & FH_RSCSR_FRAME_SIZE_MSK;
  214. if (WARN_ON(pkt->hdr.cmd != TIME_EVENT_CMD))
  215. return true;
  216. if (WARN_ON_ONCE(resp_len != sizeof(pkt->hdr) + sizeof(*resp))) {
  217. IWL_ERR(mvm, "Invalid TIME_EVENT_CMD response\n");
  218. return true;
  219. }
  220. resp = (void *)pkt->data;
  221. /* we should never get a response to another TIME_EVENT_CMD here */
  222. if (WARN_ON_ONCE(le32_to_cpu(resp->id) != te_data->id))
  223. return false;
  224. te_data->uid = le32_to_cpu(resp->unique_id);
  225. IWL_DEBUG_TE(mvm, "TIME_EVENT_CMD response - UID = 0x%x\n",
  226. te_data->uid);
  227. return true;
  228. }
  229. static int iwl_mvm_time_event_send_add(struct iwl_mvm *mvm,
  230. struct ieee80211_vif *vif,
  231. struct iwl_mvm_time_event_data *te_data,
  232. struct iwl_time_event_cmd *te_cmd)
  233. {
  234. static const u8 time_event_response[] = { TIME_EVENT_CMD };
  235. struct iwl_notification_wait wait_time_event;
  236. int ret;
  237. lockdep_assert_held(&mvm->mutex);
  238. IWL_DEBUG_TE(mvm, "Add new TE, duration %d TU\n",
  239. le32_to_cpu(te_cmd->duration));
  240. spin_lock_bh(&mvm->time_event_lock);
  241. if (WARN_ON(te_data->id != TE_MAX)) {
  242. spin_unlock_bh(&mvm->time_event_lock);
  243. return -EIO;
  244. }
  245. te_data->vif = vif;
  246. te_data->duration = le32_to_cpu(te_cmd->duration);
  247. te_data->id = le32_to_cpu(te_cmd->id);
  248. list_add_tail(&te_data->list, &mvm->time_event_list);
  249. spin_unlock_bh(&mvm->time_event_lock);
  250. /*
  251. * Use a notification wait, which really just processes the
  252. * command response and doesn't wait for anything, in order
  253. * to be able to process the response and get the UID inside
  254. * the RX path. Using CMD_WANT_SKB doesn't work because it
  255. * stores the buffer and then wakes up this thread, by which
  256. * time another notification (that the time event started)
  257. * might already be processed unsuccessfully.
  258. */
  259. iwl_init_notification_wait(&mvm->notif_wait, &wait_time_event,
  260. time_event_response,
  261. ARRAY_SIZE(time_event_response),
  262. iwl_mvm_time_event_response, te_data);
  263. ret = iwl_mvm_send_cmd_pdu(mvm, TIME_EVENT_CMD, CMD_SYNC,
  264. sizeof(*te_cmd), te_cmd);
  265. if (ret) {
  266. IWL_ERR(mvm, "Couldn't send TIME_EVENT_CMD: %d\n", ret);
  267. iwl_remove_notification(&mvm->notif_wait, &wait_time_event);
  268. goto out_clear_te;
  269. }
  270. /* No need to wait for anything, so just pass 1 (0 isn't valid) */
  271. ret = iwl_wait_notification(&mvm->notif_wait, &wait_time_event, 1);
  272. /* should never fail */
  273. WARN_ON_ONCE(ret);
  274. if (ret) {
  275. out_clear_te:
  276. spin_lock_bh(&mvm->time_event_lock);
  277. iwl_mvm_te_clear_data(mvm, te_data);
  278. spin_unlock_bh(&mvm->time_event_lock);
  279. }
  280. return ret;
  281. }
  282. void iwl_mvm_protect_session(struct iwl_mvm *mvm,
  283. struct ieee80211_vif *vif,
  284. u32 duration, u32 min_duration)
  285. {
  286. struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
  287. struct iwl_mvm_time_event_data *te_data = &mvmvif->time_event_data;
  288. struct iwl_time_event_cmd time_cmd = {};
  289. lockdep_assert_held(&mvm->mutex);
  290. if (te_data->running &&
  291. time_after(te_data->end_jiffies,
  292. jiffies + TU_TO_JIFFIES(min_duration))) {
  293. IWL_DEBUG_TE(mvm, "We have enough time in the current TE: %u\n",
  294. jiffies_to_msecs(te_data->end_jiffies - jiffies));
  295. return;
  296. }
  297. if (te_data->running) {
  298. IWL_DEBUG_TE(mvm, "extend 0x%x: only %u ms left\n",
  299. te_data->uid,
  300. jiffies_to_msecs(te_data->end_jiffies - jiffies));
  301. /*
  302. * we don't have enough time
  303. * cancel the current TE and issue a new one
  304. * Of course it would be better to remove the old one only
  305. * when the new one is added, but we don't care if we are off
  306. * channel for a bit. All we need to do, is not to return
  307. * before we actually begin to be on the channel.
  308. */
  309. iwl_mvm_stop_session_protection(mvm, vif);
  310. }
  311. time_cmd.action = cpu_to_le32(FW_CTXT_ACTION_ADD);
  312. time_cmd.id_and_color =
  313. cpu_to_le32(FW_CMD_ID_AND_COLOR(mvmvif->id, mvmvif->color));
  314. time_cmd.id = cpu_to_le32(TE_BSS_STA_AGGRESSIVE_ASSOC);
  315. time_cmd.apply_time =
  316. cpu_to_le32(iwl_read_prph(mvm->trans, DEVICE_SYSTEM_TIME_REG));
  317. time_cmd.dep_policy = TE_INDEPENDENT;
  318. time_cmd.is_present = cpu_to_le32(1);
  319. time_cmd.max_frags = cpu_to_le32(TE_FRAG_NONE);
  320. time_cmd.max_delay = cpu_to_le32(500);
  321. /* TODO: why do we need to interval = bi if it is not periodic? */
  322. time_cmd.interval = cpu_to_le32(1);
  323. time_cmd.interval_reciprocal = cpu_to_le32(iwl_mvm_reciprocal(1));
  324. time_cmd.duration = cpu_to_le32(duration);
  325. time_cmd.repeat = cpu_to_le32(1);
  326. time_cmd.notify = cpu_to_le32(TE_NOTIF_HOST_EVENT_START |
  327. TE_NOTIF_HOST_EVENT_END);
  328. iwl_mvm_time_event_send_add(mvm, vif, te_data, &time_cmd);
  329. }
  330. /*
  331. * Explicit request to remove a time event. The removal of a time event needs to
  332. * be synchronized with the flow of a time event's end notification, which also
  333. * removes the time event from the op mode data structures.
  334. */
  335. void iwl_mvm_remove_time_event(struct iwl_mvm *mvm,
  336. struct iwl_mvm_vif *mvmvif,
  337. struct iwl_mvm_time_event_data *te_data)
  338. {
  339. struct iwl_time_event_cmd time_cmd = {};
  340. u32 id, uid;
  341. int ret;
  342. /*
  343. * It is possible that by the time we got to this point the time
  344. * event was already removed.
  345. */
  346. spin_lock_bh(&mvm->time_event_lock);
  347. /* Save time event uid before clearing its data */
  348. uid = te_data->uid;
  349. id = te_data->id;
  350. /*
  351. * The clear_data function handles time events that were already removed
  352. */
  353. iwl_mvm_te_clear_data(mvm, te_data);
  354. spin_unlock_bh(&mvm->time_event_lock);
  355. /*
  356. * It is possible that by the time we try to remove it, the time event
  357. * has already ended and removed. In such a case there is no need to
  358. * send a removal command.
  359. */
  360. if (id == TE_MAX) {
  361. IWL_DEBUG_TE(mvm, "TE 0x%x has already ended\n", uid);
  362. return;
  363. }
  364. /* When we remove a TE, the UID is to be set in the id field */
  365. time_cmd.id = cpu_to_le32(uid);
  366. time_cmd.action = cpu_to_le32(FW_CTXT_ACTION_REMOVE);
  367. time_cmd.id_and_color =
  368. cpu_to_le32(FW_CMD_ID_AND_COLOR(mvmvif->id, mvmvif->color));
  369. IWL_DEBUG_TE(mvm, "Removing TE 0x%x\n", le32_to_cpu(time_cmd.id));
  370. ret = iwl_mvm_send_cmd_pdu(mvm, TIME_EVENT_CMD, CMD_SYNC,
  371. sizeof(time_cmd), &time_cmd);
  372. if (WARN_ON(ret))
  373. return;
  374. }
  375. void iwl_mvm_stop_session_protection(struct iwl_mvm *mvm,
  376. struct ieee80211_vif *vif)
  377. {
  378. struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
  379. struct iwl_mvm_time_event_data *te_data = &mvmvif->time_event_data;
  380. lockdep_assert_held(&mvm->mutex);
  381. iwl_mvm_remove_time_event(mvm, mvmvif, te_data);
  382. }
  383. int iwl_mvm_start_p2p_roc(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
  384. int duration, enum ieee80211_roc_type type)
  385. {
  386. struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
  387. struct iwl_mvm_time_event_data *te_data = &mvmvif->time_event_data;
  388. struct iwl_time_event_cmd time_cmd = {};
  389. lockdep_assert_held(&mvm->mutex);
  390. if (te_data->running) {
  391. IWL_WARN(mvm, "P2P_DEVICE remain on channel already running\n");
  392. return -EBUSY;
  393. }
  394. /*
  395. * Flush the done work, just in case it's still pending, so that
  396. * the work it does can complete and we can accept new frames.
  397. */
  398. flush_work(&mvm->roc_done_wk);
  399. time_cmd.action = cpu_to_le32(FW_CTXT_ACTION_ADD);
  400. time_cmd.id_and_color =
  401. cpu_to_le32(FW_CMD_ID_AND_COLOR(mvmvif->id, mvmvif->color));
  402. switch (type) {
  403. case IEEE80211_ROC_TYPE_NORMAL:
  404. time_cmd.id = cpu_to_le32(IWL_MVM_ROC_TE_TYPE_NORMAL);
  405. break;
  406. case IEEE80211_ROC_TYPE_MGMT_TX:
  407. time_cmd.id = cpu_to_le32(IWL_MVM_ROC_TE_TYPE_MGMT_TX);
  408. break;
  409. default:
  410. WARN_ONCE(1, "Got an invalid ROC type\n");
  411. return -EINVAL;
  412. }
  413. time_cmd.apply_time = cpu_to_le32(0);
  414. time_cmd.dep_policy = cpu_to_le32(TE_INDEPENDENT);
  415. time_cmd.is_present = cpu_to_le32(1);
  416. time_cmd.interval = cpu_to_le32(1);
  417. /*
  418. * The P2P Device TEs can have lower priority than other events
  419. * that are being scheduled by the driver/fw, and thus it might not be
  420. * scheduled. To improve the chances of it being scheduled, allow them
  421. * to be fragmented, and in addition allow them to be delayed.
  422. */
  423. time_cmd.max_frags = cpu_to_le32(MSEC_TO_TU(duration)/20);
  424. time_cmd.max_delay = cpu_to_le32(MSEC_TO_TU(duration/2));
  425. time_cmd.duration = cpu_to_le32(MSEC_TO_TU(duration));
  426. time_cmd.repeat = cpu_to_le32(1);
  427. time_cmd.notify = cpu_to_le32(TE_NOTIF_HOST_EVENT_START |
  428. TE_NOTIF_HOST_EVENT_END);
  429. return iwl_mvm_time_event_send_add(mvm, vif, te_data, &time_cmd);
  430. }
  431. void iwl_mvm_stop_p2p_roc(struct iwl_mvm *mvm)
  432. {
  433. struct iwl_mvm_vif *mvmvif;
  434. struct iwl_mvm_time_event_data *te_data;
  435. lockdep_assert_held(&mvm->mutex);
  436. /*
  437. * Iterate over the list of time events and find the time event that is
  438. * associated with a P2P_DEVICE interface.
  439. * This assumes that a P2P_DEVICE interface can have only a single time
  440. * event at any given time and this time event coresponds to a ROC
  441. * request
  442. */
  443. mvmvif = NULL;
  444. spin_lock_bh(&mvm->time_event_lock);
  445. list_for_each_entry(te_data, &mvm->time_event_list, list) {
  446. if (te_data->vif->type == NL80211_IFTYPE_P2P_DEVICE) {
  447. mvmvif = iwl_mvm_vif_from_mac80211(te_data->vif);
  448. break;
  449. }
  450. }
  451. spin_unlock_bh(&mvm->time_event_lock);
  452. if (!mvmvif) {
  453. IWL_WARN(mvm, "P2P_DEVICE no remain on channel event\n");
  454. return;
  455. }
  456. iwl_mvm_remove_time_event(mvm, mvmvif, te_data);
  457. iwl_mvm_roc_finished(mvm);
  458. }