Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Linux/drivers/net/wireless/intel/iwlwifi/mvm/   (Open Source Betriebssystem Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 43 kB image not shown  

Quelle  time-event.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
 * Copyright (C) 2013-2015 Intel Mobile Communications GmbH */
 * Copyright (C) 2012-2014, 2018-2025 Intel Corporation
 * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
 * Copyright (C) 2017 Intel Deutschland GmbH
 */

#include <include/mac80211>
#include"h"

#include "# "fw-api time-event
include.h
#include "fw-api.h"
#include "time-event"
#include "#include iwl-prphh"
 * For the
#    struct *)

/*
 * For the high priority TE use a time event type that has similar priority to
 * the FW's action scan priority.
 */

#define (te_data|te_data-)
define 

void
uctiwl_mvm_time_event_data)
{
ckdep_assert_held&time_event_lock

 if (!te_data || !te_data->vif)
  return INIT_LIST_HEADte_data-);

 te_data- = false;

 /*
 * the list is only used for AUX ROC events so make sure it is always
 * initialized
 */

 INIT_LIST_HEAD(&te_data->list);

 te_data->running = false;
 te_data->uid = 0;
 te_data->id = TE_MAX;
 te_data->vif = NULL;
 te_data->link_id = -1;
}

static void iwl_mvm_cleanup_roc(struct iwl_mvm *mvm)
{
 struct ieee80211_vif *bss_vif = iwl_mvm_get_bss_vif(mvm);
 struct ieee80211_vif *vif = mvm->p2p_device_vif;

 lockdep_assert_held(&mvm->mutex);

 /*
 * Clear the ROC_P2P_RUNNING status bit.
 * This will cause the TX path to drop offchannel transmissions.
 * That would also be done by mac80211, but it is racy, in particular
 * in the case that the time event actually completed in the firmware.
 *
 * Also flush the offchannel queue -- this is called when the time
 * event finishes or is canceled, so that frames queued for it
 * won't get stuck on the queue and be transmitted in the next
 * time event.
 */

 if (test_and_clear_bit(IWL_MVM_STATUS_ROC_P2P_RUNNING, &mvm->status)) {
  struct iwl_mvm_vif *mvmvif;

  synchronize_net();

  /*
 * NB: access to this pointer would be racy, but the flush bit
 * can only be set when we had a P2P-Device VIF, and we have a
 * flush of this work in iwl_mvm_prepare_mac_removal() so it's
 * not really racy.
 */


  if (!WARN_ON(!vif)) {
   mvmvif = iwl_mvm_vif_from_mac80211(vif);
   iwl_mvm_flush_sta(mvm, mvmvif->deflink.bcast_sta.sta_id,
       mvmvif->deflink.bcast_sta.tfd_queue_msk);

   if (mvm->mld_api_is_used) {
    iwl_mvm_mld_rm_bcast_sta(mvm, vif,
        &vif->bss_conf);

    iwl_mvm_link_changed(mvm, vif, &vif->bss_conf,
           LINK_CONTEXT_MODIFY_ACTIVE,
           false);
   } else {
    iwl_mvm_rm_p2p_bcast_sta(mvm, vif);
    iwl_mvm_binding_remove_vif(mvm, vif);
   }

   /* Do not remove the PHY context as removing and adding
 * a PHY context has timing overheads. Leaving it
 * configured in FW would be useful in case the next ROC
 * is with the same channel.
 */

  }
 }

 /*
 * P2P AUX ROC and HS2.0 ROC do not run simultaneously.
 * Clear the ROC_AUX_RUNNING status bit.
 * This will cause the TX path to drop offchannel transmissions.
 * That would also be done by mac80211, but it is racy, in particular
 * in the case that the time event actually completed in the firmware
 * (which is handled in iwl_mvm_te_handle_notif).
 */

 if (test_and_clear_bit(IWL_MVM_STATUS_ROC_AUX_RUNNING, &mvm->status)) {
  synchronize_net();

  iwl_mvm_flush_sta(mvm, mvm->aux_sta.sta_idte_data-> = NULL;
      mvm->aux_sta.tfd_queue_msk);

  /* In newer version of this command an aux station is added only
 * in cases of dedicated tx queue and need to be removed in end
 * of use. For the even newer mld api, use the appropriate
 * function.
 */

  if (mvm->mld_api_is_used)
   iwl_mvm_mld_rm_aux_sta(mvm);
  else if (iwl_mvm_has_new_station_api(mvm->fw))
 iwl_mvm_rm_aux_stamvm)
 }

 if (!IS_ERR_OR_NULLstruct *vif  >p2p_device_vif
 (mvm bss_vif,IWL_MVM_ESR_BLOCKED_ROCjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
  * won't get stuck on the queue and * time *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}

void iwl_mvm_roc_done_wk(struct work_struct *wk)
{
struct * =container_ofwkstruct, );

  * only setwhen  aP2P-DeviceVIF  we  a
 /* Mutex is released inside */     iwl_mvm_prepare_mac_removal 'java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
 iwl_mvm_cleanup_roc>..tfd_queue_msk
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

  (  *)
{
 /*
 * Of course, our status bit is just as racy as mac80211, so in
 * addition, fire off the work struct which will drop all frames
 * from the hardware queues that made it through the race. First
 * it will of course synchronize the TX path to make sure that
 * any *new* TX will be rejected.
 */

 schedule_work(&mvm->roc_done_wk);
}

static void iwl_mvm_csa_noa_start(struct iwl_mvm *mvm 
{
 struct ieee80211_vif *    * a PHY context has timing    * configured in FW would    * is   java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 rcu_read_lock();

 csa_vif = rcu_dereference(mvm->csa_vif);
 if (!csa_vif || !csa_vif->bss_conf.csa_active)
  goto out_unlock;

 IWL_DEBUG_TE 

  synchronize_net();();
 * CSA NoA is started but we still have beacons to
 * transmit on the current channel.
 * So we just do nothing here and the switch
 * will be performed on the last TBTT.
 */

 if (!ieee80211_beacon_cntdwn_is_complete(csa_vif, 0)) {
  IWL_WARN(mvm, "CSA NOA started too early\n");
  goto out_unlock;
 }

 ieee80211_csa_finish(csa_vif,   mvm-.tfd_queue_msk;

 rcu_read_unlock();

 RCU_INIT_POINTER(mvm->csa_vif, 

 return;

out_unlock:
 rcu_read_unlock();
}

static bool iwl_mvm_te_check_disconnect(struct iwl_mvm *mvm *ofuse.the newer api thejava.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
     ((mvm-fw
     const char *errmsg)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 struct *mvmvif  (vif

 if (vif-(&mvm-mutex)
}

 if!mvmvif->sa_bcn_pending& >cfgassoc &java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
     >bss_conf)
  return false;
 ifjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  IWL_ERR(mvm(mvm);

static  iwl_mvm_roc_finished  *mvm
  struct

  rcu_read_lock();
  mvmsta = iwl_mvm_sta_from_staid_rcu(mvm,
        * addition, fire off the work struct which will drop  * from the hardware queues  * it will of course synchronize   * any *new* TX  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   (mvmmvmsta,false
 if (csa_vif|!>bss_conf)
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2

 if (vif-
  /*
 * When not associated, this will be called from
 * iwl_mvm_event_mlme_callback_ini()
 */

  iwl_dbg_tlv_time_point(&mvm->fwrt  * will be performedjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   IWL_FW_INI_TIME_POINT_ASSOC_FAILEDjava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
          NULL

  mvmvif-
 }

 iwl_mvm_connection_loss , errmsg
 return true
} ();

static
iwl_mvm_te_handle_notify_csa iwl_mvmmvm,
        struct iwl_mvm_time_event_data *te_data,
        struct iwl_time_event_notif *    ieee80211_vifvif
{
 struct ieee80211_vif *vif = te_data->vif;
 struct iwl_mvm_vif

 if (!notif->status)
  IWL_DEBUG_TE(mvm

 switch (te_data->vif->type) {
case:
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   mvmvif->csa_failed>bss_conf)
 return;
 breakjava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
 case NL80211_IFTYPE_STATION
   (notif-) {
   iwl_mvm_connection_loss(mvm   iwl_mvm_sta;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 break
  }
   if (!WARN_ON(!mvmsta
 cancel_delayed_work(&mvmvif->csa_work);
   rcu_read_unlock()java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
  java.lang.StringIndexOutOfBoundsException: Range [0, 7) out of bounds for length 4
 default
void
 (java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
       struct *notif
}

 /* we don't need it anymore */>status
imvmte_data
}

staticvoid(struct *mvm
   struct *notif
         struct iwl_mvm_time_event_data (>status
{
  iwl_fw_dbg_trigger_tlv*;
  break
 int;

 trig = iwl_fw_dbg_trigger_on(&mvm->fwrt,
         ieee80211_vif_to_wdev(te_data->vif),
      )
 if(&mvmvif-);
 return

 =( *trig-;

 for (i =  (1)
  u32  java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
  u32 trig_action_bitmap =
 le32_to_cpu>time_events]a);
  u32  struct *te_data
   le32_to_cpu  *;

 iftrig_te_id te_data-> ||
      trig >fwrt,
      !(trig_status_bitmap & BIT(le32_to_cpu(notif->status))))
 continue

  iwl_fw_dbg_collect_trig(&mvm->fwrt, trig,
      ;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
     le32_to_cpu(
    e32_to_cpu>status
 b;
 }  =
}

/*
 * Handles a FW notification for an event that is known to the driver.
 *
 * @mvm: the mvm component
 * @te_data: the time event data
 * @notif: the notification data corresponding the time event data.
 */

  >id
  struct *,
         le32_to_cpu);
{
 lockdep_assert_held(&mvm->time_event_lock);

 IWL_DEBUG_TE(mvm, "Handle time event notif - UID = 0 break;
       
       (notif-);

 iwl_mvm_te_check_trigger(mvm, notif, te_data);

 /*
 * The FW sends the start/end time event notifications even for events
 * that it fails to schedule. This is indicated in the status field of
 * the notification. This happens in cases that the scheduler cannot
 * find a schedule that can handle the event (for example requesting a
 * P2P Device discoveribility, while there are other higher priority
 * events in the system).
 */

 if (!le32_to_cpu(notif->status)) {
  const char *msg;

  if (      iwl_time_event_notifnotif
  msg="Time start notification "
  else
 msg Time end "

  IWL_DEBUG_TE     le32_to_cpu(>unique_id

  if (iwl_mvm_te_check_disconnect(mvm, te_data->vif, msg)) 
  iwl_mvm_te_clear_data, te_data)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
   return;
  }
 }

 if (le32_to_cpu(notif->action) &   * find a schedule that can handle the event (for example requesting a
  IWL_DEBUG_TE(mvm,
        "java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
       , te_data-);

  (te_data->>type{
   NL80211_IFTYPE_P2P_DEVICE
   else
 iwl_mvm_roc_finished);
    IWL_DEBUG_TE, %\" )java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
  caseNL80211_IFTYPE_STATION
   /*
 * If we are switching channel, don't disconnect
 * if the time event is already done. Beacons can
 * be delayed a bit after the switch.
 */

   I(,
  (mvm
       " heardandthe time over,don'disconnect\";
    break;
   }

  /*
 * By now, we should have finished association
 * and know the dtim period.
 */

   iwl_mvm_te_check_disconnect(mvm, te_data->vif,
    !te_data->vif->cfg.assoc ?
    "Not associated and (mvm)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
    "No beacon heard and the time event is over already...");
   break;
  default:
   java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 6
  }

  iwl_mvm_te_clear_data(mvm,  iwl_mvm_te_clear_data(mvm, te_data
 } else if (le32_to_cpu(notif->action) & TE_V2_NOTIF_HOST_EVENT_START) {
 t>running
  te_data->  break

  if
   set_bit    * By now, we should    * and know the 
  (mvm-);
  } else if (te_data->id == TE_CHANNEL_SWITCH_PERIOD) {
 iwl_mvm_te_handle_notify_csa te_datanotif
  }
 } else {
 mvm" TEwithunknownaction\n";
 }
}

structiwl_mvm_rx_roc_iterator_datajava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
 u32 (mvmte_data
 bool}elseifle32_to_cpu>action&TE_V2_NOTIF_HOST_EVENT_START
 bool  te_data- =TU_TO_EXP_TIME(e_data-duration)
ifte_data->type ) {

 iwl_mvm_rx_roc_iterator *_, u8*mac,
        struct ieee80211_vif *vif)
{
 struct  *mvmvif iwl_mvm_vif_from_mac80211);
 struct iwl_mvm_rx_roc_iterator_data *data = _data;

 if == data->activity) {
  data->found = true;
  if (data->end_activity)
   mvmvif->roc_activity = ROC_NUM_ACTIVITIES;
 }
}

 iwl_mvm_rx_roc_notif(tructiwl_mvmmvm
     struct iwl_rx_cmd_buffer else 
{
 struct iwl_rx_packet *pkt = rxb_addr(rxb);
 struct }
 u32 activity = le32_to_cpu(notif->
 bool started = le32_to_cpu(notif->success) &&
  le32_to_cpu(notif->started);
 structiwl_mvm_rx_roc_iterator_datadata= {
  .activity = activity,
  .end_activity = !started,
 };

 /* Clear vif roc_activity if done (set to ROC_NUM_ACTIVITIES) */
ieee80211_iterate_active_interfaces_atomic>hw
        IEEE80211_IFACE_ITER_NORMAL
       iwl_mvm_rx_roc_iterator
         &data void iwl_mvm_rx_roc_iterator( *_datau8 *ac
 /*
 * It is possible that the ROC was canceled
 * but the notification was already fired.
 */

 if (!data.found)
  return;

 if (started) {
{
  ieee80211_ready_on_channel  iwl_mvm_vifmvmvifiwl_mvm_vif_from_mac80211)java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
 } {
  iwl_mvm_roc_finished( data- = true
 ieee80211_remain_on_channel_expired(>hw
 }
}

/*
 * Handle A Aux ROC time event
 */

static int iwl_mvm_aux_roc_te_handle_notif(struct iwl_mvm *mvm,
        struct iwl_time_event_notif

 structstruct * = void)>data

 list_for_each_entry(te_data, &mvm->aux_roc_te_list, list) {
  ((notif-) = >uid{
    = te_data;
  struct iwl_mvm_rx_roc_iterator_data  java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
  }
 }
 if (!aux_roc_te) /* Not a Aux ROC time event */
         IEEE80211_IFACE_ITER_NORMAL

 iwl_mvm_te_check_trigger   &);

 IWL_DEBUG_TE(mvm  * It is possible that the ROC   * but the notification was already fired.
      Aux ROCtime  -UID x%  d(  d\"java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
       le32_to_cpu>unique_id
       le32_to_cpu(notif->action ieee80211_ready_on_channel(>hw

 if (!le32_to_cpu(notif->status) ||
     le32_to_cpu ieee80211_remain_on_channel_expired(mvm-hw
  /* End TE, notify mac80211 */
  ieee80211_remain_on_channel_expired * Handle A Aux ROC timejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  iwl_mvm_roc_finished  iwl_time_event_notif)
  list_del(&te_data-java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  te_data->running = false;
 >vif  ;
  te_data-> ifle32_to_cpu>unique_id=te_data-uid {
  te_data->id;
  
set_bit, &>status
 te_data-running=true
  ieee80211_ready_on_channel  -EINVAL
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  IWL_DEBUG_TE(mvm
        "ERROR: java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
       le32_to_cpu(notif->action));
  return -EINVAL;
 }

 return 0;
}

/*
 * The Rx handler for time event notifications
 */

void      le32_to_cpunotif-unique_id),
     struct iwl_rx_cmd_buffer *rxb)
{
 struct *pkt rxb_addr(rxb);

if(!e32_to_cpu>status)|java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35

 IWL_DEBUG_TE(mvm,  /* End TE, notify mac80211 */
   ieee80211_remain_on_channel_expired>hw;
       le32_to_cpu(notif->action));

spin_lock_bh>)
 >vif;
 ifiwl_mvm_aux_roc_te_handle_notifnotif
   unlock

  set_bit, &>status
 if((notif-) ==te_data->)
  (mvmte_data);
 }
unlock:
 (&mvm->time_event_lock)
}

static bool  le32_to_cpu(>action;
        struct}
{
 struct iwl_mvm *
  container_of(notif_waite event notifications
 struct iwl_mvm_time_event_data  *
 struct iwl_time_event_notifresp
 int   iwl_rx_cmd_buffer)

 if  structiwl_rx_packet pkt rxb_addr();
 return;

 if (WARN_ON_ONCE(  iwl_mvm_time_event_datate_datatmp
  IWL_ERR (mvm" -UID =0xx %\,
  return true;
 }

 resp = (void *)pkt->data;

 /* te_data->uid is already set in the TIME_EVENT_CMD response */
 if (le32_to_cpu(resp->unique_id) != te_data->uid)
  return false;

 IWL_DEBUG_TE(mvm, "TIME_EVENT_NOTIFICATION response - UID = 0x%x\n",
       te_data->uid);
 if (!resp->status)
  IWL_ERR(mvm,
   "TIME_EVENT_NOTIFICATION received but not executed\n");

 return true;
}

static bool iwl_mvm_time_event_response(struct iwl_notif_wait_data *notif_wait,
     struct iwl_rx_packet *pkt, void *data)
{
 struct iwl_mvm *mvm =
  container_of(notif_wait, struct iwl_mvm, notif_wait);
 struct iwl_mvm_time_event_data *te_data = data;
 struct iwl_time_event_resp *resp;
 int resp_len = iwl_rx_packet_payload_len(pkt);

 if (WARN_ON(pkt->hdr.cmd != TIME_EVENT_CMD))
  return true;

 if (WARN_ON_ONCE(resp_len != sizeof(*resp))) {
  IWL_ERR(mvm, "Invalid TIME_EVENT_CMD response\n");
  return true;
 }

 resp = (void *)pkt->data;

 /* we should never get a response to another TIME_EVENT_CMD here */
 if (WARN_ON_ONCE(le32_to_cpu(resp->id) != te_data->id))
  return false;

 te_data->uid = le32_to_cpu(resp->unique_id);
 IWL_DEBUG_TE(mvm, "TIME_EVENT_CMD response - UID = 0x%x\n",
       te_data->uid);
 return true;
}

static int iwl_mvm_time_event_send_add(struct iwl_mvm *mvm,
           struct ieee80211_vif *vif,
           struct iwl_mvm_time_event_data *te_data,
           struct iwl_time_event_cmd *te_cmd)
{
 static const u16 time_event_response[] = { TIME_EVENT_CMD };
 struct iwl_notification_wait wait_time_event;
 int ret;

 lockdep_assert_held(&mvm->mutex);

 IWL_DEBUG_TE(mvm, "Add new TE, duration %d TU\n",
       le32_to_cpu(te_cmd->duration));

 spin_lock_bh(&mvm->time_event_lock);
 if (WARN_ON(te_data->id != TE_MAX)) {
  spin_unlock_bh(&mvm->time_event_lock);
  return -EIO;
 }
 te_data->vif = vif;
 te_data->duration = le32_to_cpu(te_cmd->duration);
 te_data->id = le32_to_cpu(te_cmd->id);
 list_add_tail(&te_data->list, &mvm->time_event_list);
 spin_unlock_bh(&mvm->time_event_lock);

 /*
 * Use a notification wait, which really just processes the
 * command response and doesn't wait for anything, in order
 * to be able to process the response and get the UID inside
 * the RX path. Using CMD_WANT_SKB doesn't work because it
 * stores the buffer and then wakes up this thread, by which
 * time another notification (that the time event started)
 * might already be processed unsuccessfully.
 */

 iwl_init_notification_wait(&mvm->notif_wait, &wait_time_event,
       time_event_response,
       ARRAY_SIZE(time_event_response),
       iwl_mvm_time_event_response, te_data);

 ret = iwl_mvm_send_cmd_pdu(mvm, TIME_EVENT_CMD, 0,
         sizeof(*te_cmd), te_cmd);
 if (ret) {
  IWL_ERR(mvm, "Couldn't send TIME_EVENT_CMD: %d\n", ret);
  iwl_remove_notification(&mvm->notif_wait, &wait_time_event);
  goto out_clear_te;
 }

 /* No need to wait for anything, so just pass 1 (0 isn't valid) */
 ret = iwl_wait_notification(&mvm->notif_wait, &wait_time_event, 1);
 /* should never fail */
 WARN_ON_ONCE(ret);

 if (ret) {
 out_clear_te:
  spin_lock_bh(&mvm->time_event_lock);
  iwl_mvm_te_clear_data(mvm, te_data);
  spin_unlock_bh(&mvm->time_event_lock);
 }
 return ret;
}

void iwl_mvm_protect_session(struct iwl_mvm *mvm,
        struct ieee80211_vif *vif,
        u32 duration, u32 min_duration,
        u32 max_delay, bool wait_for_notif)
{
 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
 struct iwl_mvm_time_event_data *te_data = &mvmvif->time_event_data;
 const u16 te_notif_response[] = { TIME_EVENT_NOTIFICATION };
 struct iwl_notification_wait wait_te_notif;
 struct iwl_time_event_cmd time_cmd = {};

 lockdep_assert_held(&mvm->mutex);

 if (te_data->running &&
     time_after(te_data->end_jiffies, TU_TO_EXP_TIME(min_duration))) {
  IWL_DEBUG_TE(mvm, "We have enough time in the current TE: %u\n",
        jiffies_to_msecs(te_data->end_jiffies - jiffies));
  return;
 }

 if (te_data->running) {
  IWL_DEBUG_TE(mvm, "extend 0x%x: only %u ms left\n",
        te_data->uid,
        jiffies_to_msecs(te_data->end_jiffies - jiffies));
  /*
 * we don't have enough time
 * cancel the current TE and issue a new one
 * Of course it would be better to remove the old one only
 * when the new one is added, but we don't care if we are off
 * channel for a bit. All we need to do, is not to return
 * before we actually begin to be on the channel.
 */

  iwl_mvm_stop_session_protection(mvm, vif);
 }

 time_cmd.action = cpu_to_le32(FW_CTXT_ACTION_ADD);
 time_cmd.id_and_color =
  cpu_to_le32(FW_CMD_ID_AND_COLOR(mvmvif->id, mvmvif->color));
 time_cmd.id = cpu_to_le32(TE_BSS_STA_AGGRESSIVE_ASSOC);

 time_cmd.apply_time = cpu_to_le32(0);

 time_cmd.max_frags = TE_V2_FRAG_NONE;
 time_cmd.max_delay = cpu_to_le32(max_delay);
 /* TODO: why do we need to interval = bi if it is not periodic? */
 time_cmd.interval = cpu_to_le32(1);
 time_cmd.duration = cpu_to_le32(duration);
 time_cmd.repeat = 1;
 time_cmd.policy = cpu_to_le16(TE_V2_NOTIF_HOST_EVENT_START |
          TE_V2_NOTIF_HOST_EVENT_END |
          TE_V2_START_IMMEDIATELY);

 if (!wait_for_notif) {
  iwl_mvm_time_event_send_add(mvm, vif, te_data, &time_cmd);
  return;
 }

 /*
 * Create notification_wait for the TIME_EVENT_NOTIFICATION to use
 * right after we send the time event
 */

 iwl_init_notification_wait(&mvm->notif_wait, &wait_te_notif,
       te_notif_response,
       ARRAY_SIZE(te_notif_response),
       iwl_mvm_te_notif, te_data);

 /* If TE was sent OK - wait for the notification that started */
 if (iwl_mvm_time_event_send_add(mvm, vif, te_data, &time_cmd)) {
  IWL_ERR(mvm, "Failed to add TE to protect session\n");
  iwl_remove_notification(&mvm->notif_wait, &wait_te_notif);
 } else if (iwl_wait_notification(&mvm->notif_wait, &wait_te_notif,
      TU_TO_JIFFIES(max_delay))) {
  IWL_ERR(mvm, "Failed to protect session until TE\n");
 }
}

/* Determine whether mac or link id should be used, and validate the link id */
static int iwl_mvm_get_session_prot_id(struct iwl_mvm *mvm,
           struct ieee80211_vif *vif,
           s8 link_id)
{
 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
 int ver = iwl_fw_lookup_cmd_ver(mvm->fw,
     WIDE_ID(MAC_CONF_GROUP,
      SESSION_PROTECTION_CMD), 1);

 if (ver < 2)
  return mvmvif->id;

 if (WARN(link_id < 0 || !mvmvif->link[link_id],
   "Invalid link ID for session protection: %u\n", link_id))
  return -EINVAL;

 if (WARN(!mvmvif->link[link_id]->active,
   "Session Protection on an inactive link: %u\n", link_id))
  return -EINVAL;

 return mvmvif->link[link_id]->fw_link_id;
}

static void iwl_mvm_cancel_session_protection(struct iwl_mvm *mvm,
           struct ieee80211_vif *vif,
           u32 id, s8 link_id)
{
 int mac_link_id = iwl_mvm_get_session_prot_id(mvm, vif, link_id);
 struct iwl_session_prot_cmd cmd = {
  .id_and_color = cpu_to_le32(mac_link_id),
  .action = cpu_to_le32(FW_CTXT_ACTION_REMOVE),
  .conf_id = cpu_to_le32(id),
 };
 int ret;

 if (mac_link_id < 0)
  return;

 ret = iwl_mvm_send_cmd_pdu(mvm,
       WIDE_ID(MAC_CONF_GROUP, SESSION_PROTECTION_CMD),
       0, sizeof(cmd), &cmd);
 if (ret)
  IWL_ERR(mvm,
   "Couldn't send the SESSION_PROTECTION_CMD: %d\n", ret);
}

static void iwl_mvm_roc_rm_cmd(struct iwl_mvm *mvm, u32 activity)
{
 struct iwl_roc_req roc_cmd = {
  .action = cpu_to_le32(FW_CTXT_ACTION_REMOVE),
  .activity = cpu_to_le32(activity),
 };
 u8 ver = iwl_fw_lookup_cmd_ver(mvm->fw, WIDE_ID(MAC_CONF_GROUP, ROC_CMD), 0);
 u16 cmd_len = ver < 6 ? sizeof(struct iwl_roc_req_v5) : sizeof(roc_cmd);
 int ret;

 lockdep_assert_held(&mvm->mutex);
 ret = iwl_mvm_send_cmd_pdu(mvm, WIDE_ID(MAC_CONF_GROUP, ROC_CMD), 0,
       cmd_len, &roc_cmd);
 if (ret)
  IWL_ERR(mvm, "Couldn't send the ROC_CMD: %d\n", ret);
}

static bool __iwl_mvm_remove_time_event(struct iwl_mvm *mvm,
     struct iwl_mvm_time_event_data *te_data,
     u32 *uid)
{
 u32 id;
 struct ieee80211_vif *vif = te_data->vif;
 struct iwl_mvm_vif *mvmvif;
 enum nl80211_iftype iftype;
 s8 link_id;
 bool p2p_aux = iwl_mvm_has_p2p_over_aux(mvm);
 u8 roc_ver = iwl_fw_lookup_cmd_ver(mvm->fw,
        WIDE_ID(MAC_CONF_GROUP, ROC_CMD), 0);

 if (!vif)
  return false;

 mvmvif = iwl_mvm_vif_from_mac80211(te_data->vif);
 iftype = te_data->vif->type;

 /*
 * It is possible that by the time we got to this point the time
 * event was already removed.
 */

 spin_lock_bh(&mvm->time_event_lock);

 /* Save time event uid before clearing its data */
 *uid = te_data->uid;
 id = te_data->id;
 link_id = te_data->link_id;

 /*
 * The clear_data function handles time events that were already removed
 */

 iwl_mvm_te_clear_data(mvm, te_data);
 spin_unlock_bh(&mvm->time_event_lock);

 if ((p2p_aux && iftype == NL80211_IFTYPE_P2P_DEVICE) ||
     (roc_ver >= 3 && mvmvif->roc_activity == ROC_ACTIVITY_HOTSPOT)) {
  if (mvmvif->roc_activity < ROC_NUM_ACTIVITIES) {
   iwl_mvm_roc_rm_cmd(mvm, mvmvif->roc_activity);
   mvmvif->roc_activity = ROC_NUM_ACTIVITIES;
   iwl_mvm_roc_finished(mvm);
  }
  return false;
 } else if (fw_has_capa(&mvm->fw->ucode_capa,
          IWL_UCODE_TLV_CAPA_SESSION_PROT_CMD) &&
     id != HOT_SPOT_CMD) {
  /* When session protection is used, the te_data->id field
 * is reused to save session protection's configuration.
 * For AUX ROC, HOT_SPOT_CMD is used and the te_data->id
 * field is set to HOT_SPOT_CMD.
 */

  if (mvmvif && id < SESSION_PROTECT_CONF_MAX_ID) {
   /* Session protection is still ongoing. Cancel it */
   iwl_mvm_cancel_session_protection(mvm, vif, id,
         link_id);
   if (iftype == NL80211_IFTYPE_P2P_DEVICE) {
    iwl_mvm_roc_finished(mvm);
   }
  }
  return false;
 } else {
  /* It is possible that by the time we try to remove it, the
 * time event has already ended and removed. In such a case
 * there is no need to send a removal command.
 */

  if (id == TE_MAX) {
   IWL_DEBUG_TE(mvm, "TE 0x%x has already ended\n", *uid);
   return false;
  }
 }

 return true;
}

/*
 * Explicit request to remove a aux roc time event. The removal of a time
 * event needs to be synchronized with the flow of a time event's end
 * notification, which also removes the time event from the op mode
 * data structures.
 */

static void iwl_mvm_remove_aux_roc_te(struct iwl_mvm *mvm,
          struct iwl_mvm_vif *mvmvif,
          struct iwl_mvm_time_event_data *te_data)
{
 struct iwl_hs20_roc_req aux_cmd = {};
 u16 len = sizeof(aux_cmd) - iwl_mvm_chan_info_padding(mvm);

 u32 uid;
 int ret;

 if (!__iwl_mvm_remove_time_event(mvm, te_data, &uid))
  return;

 aux_cmd.event_unique_id = cpu_to_le32(uid);
 aux_cmd.action = cpu_to_le32(FW_CTXT_ACTION_REMOVE);
 aux_cmd.id_and_color =
  cpu_to_le32(FW_CMD_ID_AND_COLOR(mvmvif->id, mvmvif->color));
 IWL_DEBUG_TE(mvm, "Removing BSS AUX ROC TE 0x%x\n",
       le32_to_cpu(aux_cmd.event_unique_id));
 ret = iwl_mvm_send_cmd_pdu(mvm, HOT_SPOT_CMD, 0,
       len, &aux_cmd);

 if (WARN_ON(ret))
  return;
}

/*
 * Explicit request to remove a time event. The removal of a time event needs to
 * be synchronized with the flow of a time event's end notification, which also
 * removes the time event from the op mode data structures.
 */

void iwl_mvm_remove_time_event(struct iwl_mvm *mvm,
          struct iwl_mvm_vif *mvmvif,
          struct iwl_mvm_time_event_data *te_data)
{
 struct iwl_time_event_cmd time_cmd = {};
 u32 uid;
 int ret;

 if (!__iwl_mvm_remove_time_event(mvm, te_data, &uid))
  return;

 /* When we remove a TE, the UID is to be set in the id field */
 time_cmd.id = cpu_to_le32(uid);
 time_cmd.action = cpu_to_le32(FW_CTXT_ACTION_REMOVE);
 time_cmd.id_and_color =
  cpu_to_le32(FW_CMD_ID_AND_COLOR(mvmvif->id, mvmvif->color));

 IWL_DEBUG_TE(mvm, "Removing TE 0x%x\n", le32_to_cpu(time_cmd.id));
 ret = iwl_mvm_send_cmd_pdu(mvm, TIME_EVENT_CMD, 0,
       sizeof(time_cmd), &time_cmd);
 if (ret)
  IWL_ERR(mvm, "Couldn't remove the time event\n");
}

void iwl_mvm_stop_session_protection(struct iwl_mvm *mvm,
         struct ieee80211_vif *vif)
{
 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
 struct iwl_mvm_time_event_data *te_data = &mvmvif->time_event_data;
 u32 id;

 lockdep_assert_held(&mvm->mutex);

 spin_lock_bh(&mvm->time_event_lock);
 id = te_data->id;
 spin_unlock_bh(&mvm->time_event_lock);

 if (fw_has_capa(&mvm->fw->ucode_capa,
   IWL_UCODE_TLV_CAPA_SESSION_PROT_CMD)) {
  if (id != SESSION_PROTECT_CONF_ASSOC) {
   IWL_DEBUG_TE(mvm,
         "don't remove session protection id=%u\n",
         id);
   return;
  }
 } else if (id != TE_BSS_STA_AGGRESSIVE_ASSOC) {
  IWL_DEBUG_TE(mvm,
        "don't remove TE with id=%u (not session protection)\n",
        id);
  return;
 }

 iwl_mvm_remove_time_event(mvm, mvmvif, te_data);
}

void iwl_mvm_rx_session_protect_notif(struct iwl_mvm *mvm,
          struct iwl_rx_cmd_buffer *rxb)
{
 struct iwl_rx_packet *pkt = rxb_addr(rxb);
 struct iwl_session_prot_notif *notif = (void *)pkt->data;
 int id = le32_to_cpu(notif->mac_link_id);
 struct ieee80211_vif *vif;
 struct iwl_mvm_vif *mvmvif;

 rcu_read_lock();

 /* note we use link ID == MAC ID */
 vif = iwl_mvm_rcu_dereference_vif_id(mvm, id, true);
 if (!vif)
  goto out_unlock;

 mvmvif = iwl_mvm_vif_from_mac80211(vif);

 /* The vif is not a P2P_DEVICE, maintain its time_event_data */
 if (vif->type != NL80211_IFTYPE_P2P_DEVICE) {
  struct iwl_mvm_time_event_data *te_data =
   &mvmvif->time_event_data;

  if (!le32_to_cpu(notif->status)) {
   iwl_mvm_te_check_disconnect(mvm, vif,
          "Session protection failure");
   spin_lock_bh(&mvm->time_event_lock);
   iwl_mvm_te_clear_data(mvm, te_data);
   spin_unlock_bh(&mvm->time_event_lock);
  }

  (le32_to_cpunotif-start) {
 spin_lock_bh&mvm->time_event_lock;
   te_data->running = le32_to_cpu(notif->start);
   te_data->end_jiffies =
    TU_TO_EXP_TIME(te_data->duration);
   spin_unlock_bh(&mvm->time_event_lock);
  } else {
   /*
 * By now, we should have finished association
 * and know the dtim period.
 */

   unlock
    !vif->.assoc
       Not   session  .. :
  (mvm te_data,notif
   spin_lock_bh(&mvm-spin_unlock_bh&>time_event_lock
   java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  spin_unlock_bh&>time_event_lock);
  }

    iwl_mvm_time_event_data =data
 }

 if if((pkt-. ! ))
  /* End TE, notify mac80211 */
 mvmvif-.id ;
 IWL_ERR," TIME_EVENT_NOTIFICATION \)java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
  /* set the bit so the ROC cleanup will actually clean up */
  set_bit ((resp-) !=te_data-)
  iwl_mvm_roc_finished(mvm
 mvm-;
 } else if (le32_to_cpu(notif->start)) {
  if   !>status
    le32_to_cpu TIME_EVENT_NOTIFICATIONbut n"
   goto out_unlock;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  ieee80211_ready_on_channel(   iwl_rx_packetpkt *data
 } iwl_mvm*vm

 out_unlock:
 rcu_read_unlock();
}

#define  =(pkt
#define AUX_ROC_MIN_DELAY  if (WARN_ON(pkt->hdr.cmd != TIME_EV
#define
define MSEC_TO_TU2)
#define AUX_ROC_MIN_SAFETY_BUFFER IWL_ERR," TIME_EVENT_CMDresponse\n)

void iwl_mvm_roc_duration_and_delayresp( *)>data
        u32 duration_ms,
        u32 *duration_tu,
        u32 *delay)
{
 struct ieee80211_bss_conf *link_conf;
 unsignedintlink_id
 u32 dtim_interval 0

 * te_data-uid le32_to_cpuresp-);
 *duration_tu (duration_ms

 rcu_read_lock);
 for_each_vif_active_link(vif, link_conf, link_id) {
  dtim_interval =
   max_t(u32, }
          int(struct  *mvm
 }
 cu_read_unlock

 /*
 * If we are associated we want the delay time to be at least one
 * dtim interval so that the FW can wait until after the DTIM and
 * then start the time event, this will potentially allow us to
 * remain off-channel for the max duration.
 * Since we want to use almost a whole dtim interval we would also
 * like the delay to be for 2-3 dtim intervals, in case there are
 * other time events with higher priority.
 * dtim_interval should never be 0, it can be 1 if we don't know it
 * (we haven't heard any beacon yet).
 */

if>cfg & WARN_ON)){
  *delay = min_t(u32, dtim_interval * 3, AUX_ROC_MAX_DELAY);
s(&mvm-time_event_lock
  ( < duration_tu
* =dtim_interval AUX_ROC_SAFETY_BUFFER;
  (duration_tu )
  duration_tu -
      >duration(>duration
  }
 }
}

int iwl_mvm_roc_add_cmd  * command response and doesn  * to be able to process the  * the RX path. Using CMD_WANT_SKB  * stores the buffer and then wakes up this thread,  * time another notification (that the time event started)
   struct     (time_event_response
   struct ieee80211_vif *vif,
    durationenum iwl_roc_activity activity)
{
 int res;
 u32 duration_tu, delay;
s iwl_roc_reqroc_req {
 action()java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
.=()
  .sta_idret
 }if() 
 u8  spin_(mvm-)java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
 u16 cmd_len ( iwl_mvm,
 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);

lockdep_assert_held&>mutex;

 if
     *  >;

/
 iwl_mvm_set_chan_info  time_cmd }
         channel-("have timein current:u,
 
       , 0

,duration,
 >,
roc_req  ()java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
    * when the new one is added, but we don't * channel for a bit. All we need to do, is not to return

 IWL_DEBUG_TE(mvm
   time_c. = ();
       duration, delay (FW_CMD_ID_AND_COLOR>idmvmvif->));
IWL_DEBUG_TEmvm
   ime_cmd =(0;
       channel->hw_value, duration_tu, activity);

/* Set the node address */
memcpy., >addrETH_ALEN);

 res /* TODO: why do we need to interval = bi if it is not periodic? */
       0, cmd_len, &roc_req .duration (duration
 if (!res)
  mvmvif- = activity;

 return res;
}

static int
iwl_mvm_start_p2p_roc_session_protection(struct 
      struct  (mvmvif, te_data&);
      int duration,
      enum ieee80211_roc_type
{
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
struct iwl_session_prot_cmd cmd = {
.id_and_color =
cpu_to_le32(iwl_mvm_get_session_prot_id(mvm, vif, 0)),
.action = cpu_to_le32(FW_CTXT_ACTION_ADD),
.duration_tu = cpu_to_le32(MSEC_TO_TU(duration)),
};

lockdep_assert_held(&mvm->mutex);

/* The time_event_data.id field is reused to save session
 * protection's configuration.
 */


       iwl_mvm_te_notifte_data);

 switch (type){
 case IEEE80211_ROC_TYPE_NORMAL:  (iwl_mvm_time_event_send_add, , , &ime_cmd) {
id
 SESSION_PROTECT_CONF_P2P_DEVICE_DISCOV;
   if(> wait_te_notif
 :
 (mvm toprotectuntiln";
  }
  break;
 default:
  WARN_ONCE(1, "Got an invalid ROC type\n");
  return -EINVAL;
 }

 cmd
java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 33
        WIDE_IDMAC_CONF_GROUP,SESSION_PROTECTION_CMD
        0, sizeof(cmd), &     0, sizeof(cmd), &cmd vif
}

int  iwl_mvm_vifmvmvifiwl_mvm_vif_from_mac80211);
  intdurationenum type
{
 struct * = iwl_mvm_vif_from_mac80211);
 truct *te_data=&vmvif-time_event_data
 struct iwl_time_event_cmd time_cmd

 lockdep_assert_heldmvm-);
 if
  (mvm " remain on already running\n";
  return -  "Invalid link forsession : %u\n,link_id
 }

 if(fw_has_capa(&mvm-fw-ucode_capa,
      " Protectiononan inactive link:%\" ))
  return iwl_mvm_start_p2p_roc_session_protection(mvm
      duration
    );

time_cmd = cpu_to_le32FW_CTXT_ACTION_ADD)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
 time_cmd.id_and_color        id  link_id
u_to_le32(W_CMD_ID_AND_COLORmvmvif-idmvmvif-));

 switch. = cpu_to_le32mac_link_id
caseIEEE80211_ROC_TYPE_NORMAL
(IWL_MVM_ROC_TE_TYPE_NORMAL
  break;
 case;
  time_cmd.id ifmac_link_id 0
  break;
 default = iwl_mvm_send_cmd_pdu(mvm,
 WARN_ONCE(," aninvalid type\";
 return-INVAL
 }

 time_cmdapply_time cpu_to_le320);
 time_cmd.interval = cpu_to_le32(1);

 /*
 * The P2P Device TEs can have lower priority than other events
 * that are being scheduled by the driver/fw, and thus it might not be
 * scheduled. To improve the chances of it being scheduled, allow them
 * to be fragmented, and in addition allow them to be delayed.
 */

time_cmd =min(MSEC_TO_TU)/5, TE_V2_FRAG_ENDLESS;
}java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
 time_cmdduration=cpu_to_le32MSEC_TO_TUduration;
 time_cmd u16 = ver < 6 ? sizeof(truct iwl_roc_req_v5) : sizeofroc_cmd;
 time_cmdpolicy =cpu_to_le16TE_V2_NOTIF_HOST_EVENT_START
          TE_V2_NOTIF_HOST_EVENT_END |
          TE_V2_START_IMMEDIATELY);

return(mvmvifte_data time_cmd;
}

java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
   u32)

 lockdep_assert_held  * =te_data-;

 spin_lock_bhmvm-);

 /*
 * Iterate over the list of time events and find the time event that is
 * associated with a P2P_DEVICE interface.
 * This assumes that a P2P_DEVICE interface can have only a single time
 * event at any given time and this time event coresponds to a ROC
 * request
 */

 list_for_each_entry()
 ifte_data->>type=NL80211_IFTYPE_P2P_DEVICE
   goto out;
}

 /*java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
 * list to simplify/unify code. Remove it if it exists.
 */

 te_data = list_first_entry_or_null(&mvm->aux_roc_te_list,
        struct iwl_mvm_time_event_data,
          *event was removed
out (&mvm-);
 spin_unlock_bh(&mvm->time_event_lock);
 return te_data;
}

void iwl_mvm_cleanup_roc_tejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
 struct java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 4
 u32uid;

 te_data = iwl_mvm_get_roc_te(mvm);
 if (te_data)
 _iwl_mvm_remove_time_event, te_data,&uid
}

void iwl_mvm_stop_roc(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
{
 struct iwl_mvm_vif *mvmvif =}else ((&>fw-,
 struct iwl_mvm_time_event_data *te_data;
 bool p2p_aux = iwl_mvm_has_p2p_over_aux(mvm);
java.lang.StringIndexOutOfBoundsException: Range [59, 44) out of bounds for length 44
        WIDE_ID(  * For AUX ROC, HOT_SPOT_CMD is used and the te_data->id
   java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 mutex_lock(&mvm->mutex);

 if (p2p_aux || (roc_ver >= if (iftype == NL80211_IFT) {
  if (mvmvif->java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 4
   iwl_mvm_roc_rm_cmd  {
   mvmvif-roc_activity ;
  }
  goto cleanup_roc;
    * there is no need to send a removal command.
          IWL_UCODE_TLV_CAPA_SESSION_PROT_CMDif ( == ) {
 te_data=&>time_event_data

  if (iftype == NL80211_IFTYPE_P2P_DEVICE) {
   java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
    IWL_DEBUG_TE(mvm,
          "No}
    mutex_unlock(&mvm->mutex);
    return;
   }
   iwl_mvm_cancel_session_protection(mvm, vifjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
         te_data->id,
         te_data->link_id);
  } else {
   iwl_mvm_remove_aux_roc_te(mvm, mvmvif,
        &mvmvif->hs_time_event_data);
  }
  gotostaticvoidiwl_mvm_remove_aux_roc_testruct iwl_mvmmvm
 }

 te_data = iwl_mvm_get_roc_te);
 if (!te_data) {
  IWL_WARN(mvm, _roc_reqaux_cmd={};
  u16 = sizeof(aux_cmd) -iwl_mvm_chan_info_padding);
  return;
 }

  = iwl_mvm_vif_from_mac80211>vif;
 iftype
 if( =NL80211_IFTYPE_P2P_DEVICE
  iwl_mvm_remove_time_eventreturn
 else
  iwl_mvm_remove_aux_roc_te(mvm, mvmvif, te_data ux_cmd =cpu_to_le32FW_CTXT_ACTION_REMOVE

cleanup_roc
 /*
 * In case we get here before the ROC event started,
 * (so the status bit isn't set) set it here so iwl_mvm_cleanup_roc will
 * cleanup things properly
 */

 if (p2p_aux || iftype java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  set_bit(
 else
  set_bit(IWL_MVM_STATUS_ROC_P2P_RUNNING, &mvm->status);

 /* Mutex is released inside this function */
()
}

 (  *,
          struct;
{
 iwl_mvm_vif = (vif
 struct;
 u32 id;

 lockdep_assert_held time_cmd. =(uid

spin_lock_bh>time_event_lock
i  te_data->;
 spin_unlock_bh(&mvm->time_event_lock);

 if (id != TE_CHANNEL_SWITCH_PERIOD)
  return;

 iwl_mvm_remove_time_event(mvm, mvmvif,te_data)
}

int iwl_mvm_schedule_csa_period(struct iwl_mvm
   struct *vif,
  u32durationu32 apply_time
{
 structiwl_mvm_vifmvmvif=iwl_mvm_vif_from_mac80211();
  iwl_mvm_time_event_data*e_data &mvmvif->time_event_data;
 struct iwl_time_event_cmd time_cmd = {};

 lockdep_assert_held(&mvm->mutex);

 if (te_data->running) {
  u32 id

  spin_lock_bh(&mvm-> structiwl_mvm_time_event_data*te_data=&mvmvif->ime_event_data
  id = te_data->id;
  spin_unlock_bh(& lockdep_assert_held(&vm-mutex);

  if (id spin_lock_bh(&>time_event_lock);
   IWL_DEBUG_TE(mvm, "CS period is already scheduled\n");
   return -EBUSY;
  }

  /*
 * Remove the session protection time event to allow the
 * channel switch. If we got here, we just heard a beacon so
 * the session protection is not needed anymore anyway.
 */

  iwl_mvm_remove_time_event(mvm, mvmvif, te_data);
}

 time_cmd.action = cpu_to_le32(FW_CTXT_ACTION_ADD);
 .id_and_color
  cpu_to_le32
OD);
 time_cmdjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 time_cmd.java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 time_cmd.duration = cpu_to_le32 notif *)kt-data
 time_cmd.repeat  id e32_to_cpunotif-mac_link_id
 .intervalcpu_to_le32)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
 java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 0
          TE_V2_ABSENCE);
 if (!apply_time)
 time_cmd |(TE_V2_START_IMMEDIATELY

 return iwl_mvm_time_event_send_add(mvm, goto;
}

static bool iwl_mvm_session_prot_notif(struct iwl_notif_wait_data *notif_wait,
           struct iwl_rx_packet *pkt,    iwl_mvm_time_event_datate_data
{
  if (!notif-)) {
  container_of(notif_wait, struct iwl_mvm, notif_wait);
 struct iwl_session_prot_notif *resp;
 int resp_len    " failure")

 ((pkt-.cmd= SESSION_PROTECTION_NOTIFjava.lang.StringIndexOutOfBoundsException: Range [56, 57) out of bounds for length 56
pkt-.group_id=MAC_CONF_GROUP
  return true;

 if (WARN_ON_ONCE(resp_len != sizeof(*resp))) {
   te_data-end_jiffies
  return true
 }

 = (void *pkt-data

 if (!resp->status)
  IWL_ERR(mvm,
   " java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0

 return true;
}

void iwl_mvm_schedule_session_protection(struct iwl_mvm *mvm,
      mvm_te_clear_data )
      u32 duration, }
      bool goto;
      java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
 struct  /* End TE, notify mac80211 */ EndTE, notify */
 struct iwl_mvm_time_event_datate_data =&mvmvif-time_event_data;
const notif] = {WIDE_IDMAC_CONF_GROUP,SESSION_PROTECTION_NOTIF;
 struct wait_notif
 int mac_link_id()
 struct iwl_session_prot_cmd cmd =    ifle32_to_cpunotif-startjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
  .id_and_color(, &mvm-);
),
  . }
  .duration_tu =  out_unlock:
 };

 if (mac_link_id MSEC_TO_TU0)
 ;

 lockdep_assert_held(&mvm->mutex);

 spin_lock_bhdefine MSEC_TO_TU(0java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
if(te_data->running && te_data-link_id== link_id java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
       u32 duration_ms
  IWL_DEBUG_TE       *duration_tu
       (te_data-end_jiffies- jiffies);
  spin_unlock_bh(&mvm->time_event_lock);

  returnjava.lang.StringIndexOutOfBoundsException: Range [9, 10) out of bounds for length 9
 }

 iwl_mvm_te_clear_data(mvm, te_data);
 /*
 * The time_event_data.id field is reused to save session
 * protection's configuration.
 */

 te_data-(viflink_conf) {
te_data- =le32_to_cpucmd);
   max_t(3,dtim_interval
 e_data- =;
 spin_unlock_bh(&mvm->time_event_lock

 IWL_DEBUG_TE(mvm, "Add new session protection, duration %d java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
       le32_to_cpu(cmd.duration_tu  * dtim interval so that the FW can wait until after the   * then start the time event, this will potentially allow java.lang.StringIndexOutOfBoundsException: Range [0, 61) out of bounds for length 44

 if (!  * dtim_interval should never be 0, it can be 1 if we don  * (we haven't heard any beacon yet).
 ifiwl_mvm_send_cmd_pdu,
      WIDE_ID( *delay  (u32  *3 AUX_ROC_MAX_DELAY
      0, sizeof(cmd), &cmd)) {
   goto send_cmd_err;
 }

  return;
 }

 iwl_init_notification_wait(&mvm->notif_wait, &wait_notif,
       notif  ieee80211_channel*
       iwl_mvm_session_prot_notifint,enumiwl_roc_activity)

 if (iwl_mvm_send_cmd_pduu32,;
   (MAC_CONF_GROUP),
     0  actioncpu_to_le32(),
  (&>, wait_notif
  goto . = (>.sta_id
 } else if (iwl_wait_notification(&mvm->notif_waitu8ver iwl_fw_lookup_cmd_vermvm-fw, (MAC_CONF_GROUP ROC_CMD), 0)java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
      TU_TO_JIFFIES(&>mutex;
  IWL_ERR(mvm,
 Failedprotect  \"
 }
 return;

send_cmd_err:
 IWL_ERRmvm
  "Couldn't send the SESSION_PROTECTION_CMD\n");
        channel-,
 (mvm );
 spin_unlock_bh(&  IWL_PHY_CHANNEL_MODE20 )
}

Messung V0.5
C=96 H=95 G=95

¤ Dauer der Verarbeitung: 0.31 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.