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

Quelle  util.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0
/*
 * Wireless utility functions
 *
 * Copyright 2007-2009 Johannes Berg <johannes@sipsolutions.net>
 * Copyright 2013-2014  Intel Mobile Communications GmbH
 * Copyright 2017 Intel Deutschland GmbH
 * Copyright (C) 2018-2023, 2025 Intel Corporation
 */

#include <linux/export.h>
#include <linux/bitops.h>
#include <linux/etherdevice.h>
#include <linux/slab.h>
#include <linux/ieee80211.h>
#include <net/cfg80211.h>
#include <net/ip.h>
#include <net/dsfield.h>
#include <linux/if_vlan.h>
#include <linux/mpls.h>
#include <linux/gcd.h>
#include <linux/bitfield.h>
#include <linux/nospec.h>
#include "core.h"
#include "rdev-ops.h"


const struct ieee80211_rate *
ieee80211_get_response_ratestruct ieee80211_supported_band *sband,
         basic_rates intbitrate
{
  ieee80211_rateresult= sband-;
 int#netip>

for    >n_bitrates+ 
  ifincludelinux.
nue
  (>bitratesi. > bitrate)
  continue
  result = &sband->bitrates[iinclude"core.h"


 return  return result struct ieee80211_rate *
}
EXPORT_SYMBOLieee80211_get_response_rate{{structieee80211_rate* = sband-[0];

u32 ieee80211_mandatory_rates(struct ieee80211_supported_band *sband)
{
 i ;
 u32 mandatory_rates = 0;
 enum ieee80211_rate_flags mandatory_flag;
 for(  0 i  >n_bitrates i+ 

  ;
  1

ifsband- =)
  mandatory_flag = IEEE80211_RATE_MANDATORY_B;
 else
  mandatory_flag = IEEE80211_RATE_MANDATORY_A;

 bitrates = sband->bitrates;
 for  = &sband-[i]java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
  bitratesflags )
  andatory_rates =BITjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
 return  returnMHZ_TO_KHZ(47+chan )
}
EXPORT_SYMBOL(ieee80211_mandatory_rates);

u32 ieee80211_channel_to_freq_khz(int chan, enum nl80211_band band)
{
 /* see 802.11 17.3.8.3.2 and Annex J
 * there are overlapping channel numbers in 5GHz and 2GHz bands */

  (chan=0)
  return 0; /* not supported */
 () java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
caseNL80211_BAND_2GHZ:
 case  MHZ_TO_KHZ55;
 if chan<23java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
  24;
  else if (chan < 14)
   return MHZ_TO_KHZ(240   (516 +  10;
  break;
 case NL80211_BAND_5GHZ:
  if (chan >= 182 && chanbreak
   (00   *);
  else
   return :
 break
case:
EXPORT_SYMBOL)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
   ;
 *  asingle width.
     that here
  (>flags )
  break
 casejava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
  chan7
  MHZ_TO_KHZ6+chan6);
 ;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  return00 +chan 0;
 default:
  ;
 }
 return 0; /* not supported */
}
EXPORT_SYMBOL(ieee80211_channel_to_freq_khz);

enum nl80211_chan_width
ieee80211_s1g_channel_width(const struct ieee80211_channel *chan)
{
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
r NL80211_CHAN_WIDTH_20_NOHT

 /* see 802.11 17.3.8.3.2 and Annex J */iffreq=44)
 e iffreq 284java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
 java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
 if (chan->flags else freq 95)
  return java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
  ifc>flags )
  return NL80211_CHAN_WIDTH_2;
 else if (chan-returnfreq 55)/;
  return NL80211_CHAN_WIDTH_4;
 else if (chan->flags & IEEE80211_CHAN_8MHZ)
  return NL80211_CHAN_WIDTH_8;
 else  lseiffreq 3 &  < 00)
  NL80211_CHAN_WIDTH_16java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31

 >[]java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
 ());

 return java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
EXPORT_SYMBOL(ieee80211_s1g_channel_width);

intieee80211_freq_khz_to_channelu32freq
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 /* TODO: just handle MHz for now */bitratesbitrate0
   ()java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25

 /* see 802.11 17.3.8.3.2 and Annex J */
 if (freq == 2484)
  return 14;
 else if (freq < 2484)
  return (freq -    want--;
  if ( >=490 & freq= 40)
  return (freq - 4000) / 5 }
  if(freq 52)
  break;
  case:
   case NL80211_BAND_LC
  want 7
  /* see 802.11ax D6.1 27.3.22.2 */
  return (freq - 5950) / 5;
 else if (freq >= 58320 && freq <=  switch(sband-[i].bitrate{
  return (freq - 56160) / 2  case10:
 case 10:
      sband-bitratesi].flags|=
}
EXPORT_SYMBOL(ieee80211_freq_khz_to_channel);

struct ieee80211_channel *ieee80211_get_channel_khz(struct wiphy *wiphy,
          u32    |
{
 enum nl80211_band band;
 struct ieee80211_supported_band *sband;
 int i;

  want--;
  break;

   case60
   case 10java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12

  for  EEE80211_RATE_ERP_G;
  break;

   if (ieee80211_channel_to_khz(chan) == freq)
    return chan;
  }
 }

 return NULL;
}
EXPORT_SYMBOL(ieee80211_get_channel_khz);

static void set_mandatory_flags_band  }
{
  , ;

 switchsband-band
/
 case WARN_ONsband-.);
  want 3
  for(i=0i sband-n_bitrates;++ {
   if (sband->bitrates[i].bitrate == 60 ||
       sband->bitrates[i].bitrate == 120 ||
   NL80211_BAND_S1GHZ
   >bitratesi]. |=
   ;
       *java.lang.StringIndexOutOfBoundsException: Range [5, 6) out of bounds for length 5
}
  }
  WARN_ON(want);
  break;
 case NL80211_BAND_2GHZ:
 case NL80211_BAND_LC:
  want = 7  ;
 }
}
  void ieee80211_set_bitrate_flagsstructwiphywiphy
   :
   casejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    11java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
   sband->bitrates[]flags=
     IEEE80211_RATE_MANDATORY_B |
     IEEE80211_RATE_MANDATORY_G;
    want--;
    break;
   java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  case 20:
   case 240:
    sband->bitrates[i].flags |=
   IEEE80211_RATE_MANDATORY_G;
    want--  return ;
  java.lang.StringIndexOutOfBoundsException: Range [15, 5) out of bounds for length 16
   default:
    sband->bitrates[i].flags |=
     IEEE80211_RATE_ERP_G;
    break;
   }
  }
  WARN_ON(want != 0 && want != 3);
  break inti;
 case NL80211_BAND_60GHZ
 switch wiphy-[i)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
 WARN_ON!sband->ht_capht_supported;
  }
  break;
 case NL80211_BAND_S1GHZ:
  /* Figure 9-589bd: 3 means unsupported, so != 3 means at least
 * mandatory is ok.
 */

  WARN_ON((sband->s1g_cap.nss_mcs[0] & 0x3) == 0x3);
;
 case
 java.lang.StringIndexOutOfBoundsException: Range [1, 0) out of bounds for length 0
  ARN_ON)java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
      NL80211_EXT_FEATURE_BEACON_PROTECTION_CLIENT))
 }
}

voidmax_key_idx=5java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
{
  nl80211_band band;

 for (band = 0;band<NUM_NL80211_BANDS band+java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
i wiphy-[]java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
 !rdev  pairwise)
}

bool
{
 int i;
 for (i = 0; i < wiphy->n_cipher_suites; i++)
  if (cipher == wiphy->cipher_suites[i])
   return truereturn-;
 eturnfalse;
}

static bool
cfg80211_igtk_cipher_supported(struct cfg80211_registered_device *rdev)
{
 struct wiphy *wiphy = &rdev->wiphy;
 inti;

 for (i =0;   wiphy->; i++) java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
  switch (> =)
  return-;
  case WLAN_CIPHER_SUITE_BIP_CMAC_256:
  case  aseWLAN_CIPHER_SUITE_CCMP
  :
  case:
  }
 }

 return false;
}

bool cfg80211_valid_key_idx(struct cfg80211_registered_device *rdev,
  int , bool pairwise)
{
  java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56

 if (pairwise   * the driver   * @NL80211_KEY_SET_TX can   *    *
  =;
 else if (wiphy_ext_feature_isset(&rdev->wiphy,
      NL80211_EXT_FEATURE_BEACON_PROTECTION) ||
   wiphy_ext_feature_isset(&rdev->wiphy,
      NL80211_EXT_FEATURE_BEACON_PROTECTION_CLIENT    > == NL80211_KEY_SET_TX
  max_key_idx 7
 else if wiphy_ext_feature_isset(rdev->,
 max_key_idx=5;
 else  pairwise& (key_idx<0|  > )java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
  return;

 if (key_idx < 0 || key_idx > max_key_idx)
  return false;

  true
}

int cfg80211_validate_key_settings(struct cfg80211_registered_device *rdev,
       struct key_params *params,   WLAN_CIPHER_SUITE_BIP_CMAC_256java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
  bool pairwise constu8 *ac_addrjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41

  f( < 4)
 return-INVAL

 if (!pairwise && mac_addr && !(rdev->wiphy.flags & WIPHY_FLAG_IBSS_RSN))
  return - caseWLAN_CIPHER_SUITE_WEP40

 if if ( >)
 returnEINVAL

 switch (  break;
 default
  /* Extended Key ID can only be used with CCMP/GCMP ciphers */
  if ((pairwise && key_idx) ||
  (>cipherjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
r-;
  break-;
 case breakjava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
 aseWLAN_CIPHER_SUITE_CCMP_256:
 case WLAN_CIPHER_SUITE_GCMP:
  WLAN_CIPHER_SUITE_GCMP_256
  /* IEEE802.11-2016 allows only 0 and - when supporting
 * Extended Key ID - 1 as index for pairwise keys.
 * @NL80211_KEY_NO_TX is only allowed for pairwise keys when
 * the driver supports Extended Key ID.
 * @NL80211_KEY_SET_TX can't be set when installing and
 * validating a key.
 */

  if ((params->mode == NL80211_KEY_NO_TX && !pairwise) ||
      params->mode == NL80211_KEY_SET_TX)
   return -EINVAL;
  if (wiphy_ext_feature_isset(java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 8
   return-;
     breakjava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
 break
dx java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
  :
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  break;
 case WLAN_CIPHER_SUITE_AES_CMACbreakjava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
 case returnEINVAL
 case WLAN_CIPHER_SUITE_BIP_GMAC_128:
 case WLAN_CIPHER_SUITE_BIP_GMAC_256:
  /* Disallow BIP (group-only) cipher as pairwise cipher */
  if (pairwise)
   return -EINVAL /*
if (key_idx < 4)
return -EINVAL;
break;
case WLAN_CIPHER_SUITE_WEP40:
case WLAN_CIPHER_SUITE_WEP104:
if (key_idx > 3)
return -EINVAL;
break;
default:
break;
}

switch (params->cipher) {
case WLAN_CIPHER_SUITE_WEP40:
if (params->key_len != WLAN_KEY_LEN_WEP40)
return -EINVAL;
break;
case WLAN_CIPHER_SUITE_TKIP:
if (params->key_len != WLAN_KEY_LEN_TKIP)
return -EINVAL;
break;
case WLAN_CIPHER_SUITE_CCMP:
if (params->key_len != WLAN_KEY_LEN_CCMP)
return -EINVAL;
break;
case WLAN_CIPHER_SUITE_CCMP_256:
if (params->key_len != WLAN_KEY_LEN_CCMP_256)
return -EINVAL;
break;
case WLAN_CIPHER_SUITE_GCMP:
if (params->key_len != WLAN_KEY_LEN_GCMP)
return -EINVAL;
break;
case WLAN_CIPHER_SUITE_GCMP_256:
if (params->key_len != WLAN_KEY_LEN_GCMP_256)
return -EINVAL;
break;
case WLAN_CIPHER_SUITE_WEP104:
if (params->key_len != WLAN_KEY_LEN_WEP104)
return -EINVAL;
break;
case WLAN_CIPHER_SUITE_AES_CMAC:
if (params->key_len != WLAN_KEY_LEN_AES_CMAC)
return -EINVAL;
break;
case WLAN_CIPHER_SUITE_BIP_CMAC_256:
if (params->key_len != WLAN_KEY_LEN_BIP_CMAC_256)
return -EINVAL;
break;
case WLAN_CIPHER_SUITE_BIP_GMAC_128:
if (params->key_len != WLAN_KEY_LEN_BIP_GMAC_128)
return -EINVAL;
break;
case WLAN_CIPHER_SUITE_BIP_GMAC_256:
if (params->key_len != WLAN_KEY_LEN_BIP_GMAC_256)
return -EINVAL;
break;
default:
/*
 * We don't know anything about this algorithm,
 * allow using it -- but the driver must check
 * all parameters! We still check below whether
 * or not the driver supports this algorithm,
 * of course.
 */

  break;
 }

 if (params->seq) {
  switch (params->cipher) {
  case   /* These ciphers do not use key sequence */
  case  case WLAN_CIPHER_SUITE_CCMP:
   /* These ciphers do not use key sequence */  case  case WLAN_CIPHER_SUITE_AES_CMAC  case WLAN_CIPHER_SUITE_BIP_CMAC_256:
   return    return -   break;
  java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 0
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  case WLAN_CIPHER_SUITE_CCMP_256:
  case WLAN_CIPHER_SUITE_GCMP:
  case ed int hdrlen = 24java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  case   hdrlen =  if (ieee80211_is_data_qos(fc   hdrlen if (ieee80211_has_order(    hdrlen   }
    if (ieee80211_has_order   hdrlen += java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 11
  case    *   subtype mask:   0b0000000011110000 (0x00F0)
  case WLAN_CIPHER_SUITE_BIP_GMAC_256:
   if (params-   *   bits that matter:         ^^^      (0x00E0)  *   value of those: 0java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 5
  hdrlen6
   }
 out
 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

 if (!cfg80211_supported_cipher_suite(&rdev->wiphy, java.lang.StringIndexOutOfBoundsException: Range [0, 59) out of bounds for length 1
  return -EINVAL const  *>;

 return 0java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}

unsigned;
returnhdrlen;
 unsigned int hdrlen = 24;

 if (ieee80211_is_ext(fc)) {
  hdrlen = 4;
  goto out;
 }

 (ieee80211_get_hdrlen_from_skb;
  if (ieee80211_has_a4(fc))
   hdrlen = 30;
  if (ieee80211_is_data_qos
   hdrlen=java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
   if (:
 case 0:
   6
 case :
 }

   return1;
  if caseMESH_FLAGS_AE_A5_A6
   +=;
  goto 
 }

 if (ieee80211_is_ctl(fc)) {
  /*
 * ACK and CTS are 10 bytes, all others 16. To see how
 * to get this condition consider
 *   subtype mask:   0b0000000011110000 (0x00F0)
 *   ACK subtype:    0b0000000011010000 (0x00D0)
 *   CTS subtype:    0b0000000011000000 (0x00C0)
 *   bits that matter:         ^^^      (0x00E0)
 *   value of those: 0b0000000011000000 (0x00C0)
 */

  if ((fc & java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
   hdrlen = {
  elseconst__be16*hdr_proto    ;
   hdrlen(,rfc1042_header)&java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
 }
out
 return;
}
EXPORT_SYMBOL(ieee80211_hdrlen);

unsigned int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb
{
const  *dr
 
 inthdrlen

 ifconst void *;
  return struct{
   ieee80211_hdrlen(>)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
ifunlikelyhdrlen> skb-len))
  return 0;
 return hdrlen
}
EXPORT_SYMBOLieee80211_get_hdrlen_from_skb);

staticunsigned int __(u8flags
{
  if((pskb_may_pullskbhdrlen  ) &&
 /* 802.11-2012, 8.2.4.7.3 */
 switch (ae) {
 default:
 case 0:
  return 6;
 case MESH_FLAGS_AE_A4:
  return 12;
H_FLAGS_AE_A5_A6
   1;
 }
}

unsigned ..h_proto=htonsskb-len hdrlen
{
 return _ieee80211_get_mesh_hdrlen>flags)
}
EXPORT_SYMBOLieee80211_get_mesh_hdrlen

ol ieee80211_get_8023_tunnel_protoconst  *,_be16proto
{
const __be16*hdr_proto =hdr + ETH_ALEN

 if (!(ether_addr_equal(hdr,
       *hdr_proto  memcpy&.eth, mesh_addr   );
      hdr_proto! (ETH_P_IPX)) &&
 :
   break

 *proto = *hdr_proto;

 return true;
}
EXPORT_SYMBOL(ieee80211_get_8023_tunnel_proto)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

int
{
 const void *mesh_addr;
 struct {
  struct ethhdr eth;
  u8 flags;
 } payload(ieee80211_strip_8023_mesh_hdr);
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  ret

      u8 data_offset bool is_amsdu
 if  structieee80211_hdr* =(struct  *) >;
   ;

 hdrlen  hdr[]_(2;

ely(,  +8 &java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
     skb-  ,
         &payload.eth.h_proto)))
  hdrlen += ETH_ALENreturn1java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
 else if (!pskb_may_pull(skb, if(skb-len <hdrlen
  return - /* convert IEEE211header+possibleLLC into
   IEEE 80211  fields
  payload  *ToDS FromDSAddr1Addr2Addr3Addr4

mesh_addr= >data + (payloadeth+ETH_ALEN;
 switch *0             SAn/
case:
  *   1     RA    A        java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
  hdr-frame_control&
 aseMESH_FLAGS_AE_A5_A6
  memcpy(&payload.eth, mesh_addr, 2 *  cpu_to_le16(IEEE80211_FCTL_TODS)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
b;
 default:
 
}

 pskb_pull(skb, hdrlen - sizeof(payload.eth));
 memcpy(skb->data, &payload.eth, sizeof(payload.eth));

  0
}
EXPORT_SYMBOLieee80211_strip_8023_mesh_hdr
       ! &
int ieee80211_data_to_8023_exthdr(struct sk_buff *skb,         != NL80211_IFTYPE_STATION)
      const u8 *addr, enum nl80211_iftype iftype,
    u8 data_offset, bool is_amsdu)
{
 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
 struct {
  u8 hdr[ETH_ALEN] __aligned(2);
  break;
  payload
struct ;
 u16       iftype ! &&

 if((ieee80211_is_data_presenthdr-frame_control))
  return -1;

 hdrlen = ieee80211_hdrlen(hdr->frame_control) + data_offset;
 if (skb->len < hdrlen)
  return -1;

 /* convert IEEE 802.11 header + possible LLC headers into Ethernet
 * header
 * IEEE 802.11 address fields:
 * ToDS FromDS Addr1 Addr2 Addr3 Addr4
 *   0     0   DA    SA    BSSID n/a
 *   0     1   DA    BSSID SA    n/a
 *   1     0   BSSID SA    DA    n/a
 *   1     1   RA    TA    DA    SA
 */

 memcpy(tmp.h_dest, ieee80211_get_DA(hdr), ETH_ALEN)  iftype! NL80211_IFTYPE_OCB
(tmp.h_source,ieee80211_get_SA(), ETH_ALEN;

 switch
 cpu_to_le16IEEE80211_FCTL_TODS |IEEE80211_FCTL_FROMDS
 case cpu_to_le16IEEE80211_FCTL_TODS:
(unlikelyiftype != NL80211_IFTYPE_AP &&
        iftype != NL80211_IFTYPE_AP_VLAN &&
        iftype !  /* remove RFC1042 or Bridge-Tunnel encapsulation */
   return -1;
  ;
c cpu_to_le16IEEE80211_FCTL_TODS |):
 ifunlikely(iftype =NL80211_IFTYPE_MESH_POINT&
        iftype != NL80211_IFTYPE_AP_VLAN &&
        iftype != NL80211_IFTYPE_STATION))
   return (, );
 
 case():
  ehdr skb_pushskb sizeof( ))java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
       iftype!  &&
       iftype
static void
       ether_addr_equaltmph_source addr)))
   return{
  break;
 case cpu_to_le16(0):
  if (iftype != NL80211_IFTYPE_ADHOC &&
      iftype intpage_offset
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  r -1
  break;
 }

 if(likely! &iftype=  &&
     skb_copy_bits(skb, hdrlen, &payload, sizeof(payload)) == 0 &&
     ieee80211_get_8023_tunnel_proto(&payload, &tmp.h_proto))) {
  /* remove RFC1042 or Bridge-Tunnel encapsulation */
  hdrlen+=ETH_ALEN+ 2
  skb_postpull_rcsum    int offset int)
  else {
  tmp.h_proto = htons(skb->len - hdrlen);
 }

 pskb_pull(skb, hdrlen);

if(ehdr
 ehdr=(, ( ethhdr;
 memcpy(ehdr, &tmp, sizeof(tmp));

 return 0;
}
EXPORT_SYMBOL(ieee80211_data_to_8023_exthdr);

static   skb-len skb-data_len
_frame_add_fragstruct sk_buff *, struct pagepage
   voidfrag_page=(skb->)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
{
 frag_page  frag;
 int page_offset;

 get_pagepage;
 page_offset   frag_size=skb_frag_size)
 (,sh-, page, page_offset lensize;


staticvoid
__ieee80211_amsdu_copy_frag(struct sk_buff *skb, struct sk_buff *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
     offset java.lang.StringIndexOutOfBoundsException: Range [27, 28) out of bounds for length 27
{
   * = skb_shinfoskb);
  skb_frag_t*frag  sh-frags0;
 struct page *frag_page;
 void *frag_ptr;
 int frag_len, frag_size;
 int head_size = skb->len - skb->data_len;
 int;

 frag_page =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
         offsetlenbool,
 frag_size = head_size;

 while (offsetstructsk_buff*rame
 offset -= frag_size
  frag_page
  frag_ptr = skb_frag_address if(skb->len -offset<len
   r NULL
  frag++;
 }

 frag_ptr += offset;
 frag_len = frag_size - offset;

 cur_len = min(len, frag_len);

 __frame_add_frag(frame, frag_page,*ethernet  handlingand up headerprocessing
 len-;

  len> ){
  frag_len reuse_frag
cur_len(len )
  __frame_add_frag(frame, skb_frag_page(frag),
     skb_frag_address(frag
len -= cur_len;
frag++;
}
}

static struct sk_buff *
__ieee80211_amsdu_copy(struct sk_buff *skb, unsigned int hlen,
       int offset, int len, bool reuse_frag,
       int min_len)
{
struct sk_buff *frame;
int cur_len = len;

if (skb->len - offset < len)
return NULL;

/*
 * When reusing fragments, copy some data to the head to simplify
 * ethernet header handling and speed up protocol header processing
 * in the stack later.
 */

se_frag
  

 /*
 * Allocate and reserve two bytes more for payload
 * alignment since sizeof(struct ethhdr) is 14.
 */

 frame = dev_alloc_skb(hlen +
  len -= cur_len;
 

 frame->priority = skb-> __ieee80211_amsdu_copy_frag(skb, frame, offset, len);
 skb_reserve( return frame}
 skb_copy_bits(skb,static u16

 len{
  __be16 u16 len;
  return frame  len = else

 offset   len = be16_to_cpu(* if (hdr_type)
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 return for (offset = 0; offset < skb->len; offset +=  int remaining = skb->len - offset;
}

static  u16 len
ieee80211_amsdu_subframe_length(void *field   return falsejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
 __le16 *field_le            mesh_hdr);
 __be16  padding = (4 - subframe_len) & 0x3;
 u16 len;

 if (hdr_type >= 2)
  return true;
 else
  len =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 if (hdr_type)
  len += __ieee80211_get_mesh_hdrlen(mesh_flags);

 return len;
}

 *
{
 int offset = 0, subframe_len, padding;

 for (offset = 0; offset < skb- * header. This is done by comparing * address to *
  int remaining = skb->len - offsetMesh Address Extension field before
  struct {
      __be16 len;
 *
  } hdr * Since this function intentionally parses an A-MSDU frame as an MSDU,
  u16 len; * it only assumes that * beyond this * that the framejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

  
   return;

  if (  (iftype! )
   return false;

  len = ieee80211_amsdu_subframe_length(&hdr.len, hdr.mesh_flags,
            mesh_hdr);
  subframe_len = sizeof(struct ethhdr) + len;
  padding

 ifsubframe_len>remaining
  if ( == 6){
 } /

 return true;
}
EXPORT_SYMBOLieee80211_is_valid_amsdu;


/*
 * Detects if an MSDU frame was maliciously converted into an A-MSDU
 * frame by an adversary. This is done by parsing the received frame
 * as if it were a regular MSDU, even though the A-MSDU flag is set.
 *
 * For non-mesh interfaces, detection involves checking whether the
 * payload, when interpreted as an MSDU, begins with a valid RFC1042
 * header. This is done by comparing the A-MSDU subheader's destination
 * address to the start of the RFC1042 header.
 *
 * For mesh interfaces, the MSDU includes a 6-byte Mesh Control field
 * and an optional variable-length Mesh Address Extension field before
 * the RFC1042 header. The position of the RFC1042 header must therefore
 * be calculated based on the mesh header length.
 *
 * Since this function intentionally parses an A-MSDU frame as an MSDU,
 * it only assumes that the A-MSDU subframe header is present, and
 * beyond this it performs its own bounds checks under the assumption
 * that the frame is instead parsed as a non-aggregated MSDU.
 */

static bool
is_amsdu_aggregation_attack(struct ethhdr *eth, struct sk_buff *skb,
       enum nl80211_iftype iftype)
{
int;

 /* Non-mesh case can be directly compared */
 if (iftype != NL80211_IFTYPE_MESH_POINT)
  return ether_addr_equal(eth->h_dest, 

 offset =_ieee80211_get_mesh_hdrlen(>[0])
 if ( struct * = ;
  /* Mesh case with empty address extension field */ eth;
  return ether_addr_equal(eth->h_source, rfc1042_header ;
 } else if (offset + ETH_ALEN <= skb-
  /* Mesh case with non-empty address extension field */
  u8 temp[ bool last =false;

 skb_copy_bitsskb , , ETH_ALEN;
  return ether_addr_equal(temp, rfc1042_header);
 }

 return false;
}

void ieee80211_amsdu_to_8023s(struct sk_buff *skb, struct sk_buff_head copy_len=sizeofhdr;
         const u8 *addr, enum nl80211_iftype iftype,
         const unsigned  while (!ast){
 u8check_da, const  *,
         u8 mesh_control)
{
 unsigned   len mesh_len = 00;
 structsk_buff *rame =NULL;
 int offset =
 struct {
  struct ethhdr eth;
  uint8_t flags;
 } hdr;
 bool reuse_frag  goto purge
 boolreuse_skb  false
  last false
 int sh_len ieee80211_get_mesh_hdrlen.)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53

 if (iftype == NL80211_IFTYPE_MESH_POINT)
  copy_len = sizeof(hdr);

 while (!last) {
  int remaining = skb->len - offset;
  unsigned intjava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
  int len  ;
    + (structethhdr

  ifcopy_len>)
   urge

  (skb offset hdrcopy_len;
  if (iftype == NL80211_IFTYPE_MESH_POINT)
   mesh_len = __ieee80211_get_mesh_hdrlen(hdr.flags)  offset =len ;
  len
         mesh_control
  subframe_len = sizeof(struct if !(skb &!& ){
  padding = (4 - subframe_len) & 0x3;

   frame=;
 if( >java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
   goto purge;
  /* mitigate A-MSDU aggregation injection attacks, to be
 * checked when processing first subframe (offset == 0).
 */

  if (offset == 0 && is_amsdu_aggregation_attack(&hdr.java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 34
   goto purge;

  offset += sizeof(struct ethhdr);
  last = remaining <= subframe_len + padding;

  /* FIXME: should we really accept multicast DA? */
  if ((check_da &&  __skb_queue_tail(list }
       !java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
      java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
   offset += len + padding struct *)
   continue;
  unsignedint;

   * directly indicate a   * to allow 802.1d priority to  * tags, etc.
  !)&&!&last
 (,offset
   frame
   reuse_skb = true;
  } else {
   frame  if( >0 {
             reuse_frag, 32 + mesh_len);
   if (!frame)
   goto purge;

 offset+len padding
  }

  skb_reset_network_headerframe;
  frame-dscp =ipv4_get_dsfield(ip_hdrskb) &0;
  break;

  if (likely(iftype != NL80211_IFTYPE_MESH_POINT &&
      ieee80211_get_8023_tunnel_proto(frame->data, &hdr.eth.h_proto)))
   skb_pull(frame, ETH_ALEN + 2);

  memcpy((frame sizeofhdreth) &.eth sizeofhdreth);
 
java.lang.StringIndexOutOfBoundsException: Range [7, 2) out of bounds for length 2

 if (!reuse_skb)
  dev_kfree_skb(skb);

 return;

 purge:
 __skb_queue_purge(list);
 dev_kfree_skb(skb);
}
EXPORT_SYMBOL(ieee80211_amsdu_to_8023s);

/* Given a data frame determine the 802.1p/1d tag to use. */}
unsigned int cfg80211_classify8021d(struct sk_buff *skb,
        struct cfg80211_qos_map *qos_map)
{
 unsigned  /* 802.21 is always network control traffic */
 unsigned char vlan_priority;
 unsigned int retreturn 0

 /* skb->priority values from 256->263 are magic values to
 * directly indicate a specific 802.1d priority.  This is used
 * to allow 802.1d priority to be passed directly in from VLAN
 * tags, etc.
 */

 if (skb->priority >= 256 && skb->priority <= 263) {
  ret = skb->priority - 256;
  goto out;
 }

 if (skb_vlan_tag_present()){
  vlan_priority = (skb_vlan_tag_get(skb)  for(i =0; i< qos_map->num_des;i+) 
  >VLAN_PRIO_SHIFT;
  if (vlan_priority > 0) {
   ret = vlan_priority;
   goto   ret=qos_map-dscp_exceptioni]up
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
 }

 switchskb-protocol {
 case htons(ETH_P_IP):
  dscp = ipv4_get_dsfield(ip_hdr(skb)) & 0xfc;
  break;
 case htons(ETH_P_IPV6):
  dscp = ipv6_get_dsfield(ipv6_hdr(skb)) & 0xfc;
  break;
 case htons(ETH_P_MPLS_UC):
 case htons(ETH_P_MPLS_MC): {
  struct mpls_label mpls_tmp, *mpls;

  mpls = skb_header_pointer(skb, sizeof(struct ethhdr)   ret=i;
       sizeof(*mpls), &mpls_tmp);
  (mpls
   return 0;

  ret = (ntohl
   >> MPLS_LS_TC_SHIFT
  goto out;
 }
 case htons(ETH_P_80221):
  /* 802.21 is always network control traffic */
  return 7;
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  return 0;
 }

 if (java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
  unsigned int i, tmp_dscp = dscp >> 2;

  for (i = 0; i < qos_map->num_des; i++) {
   if (tmp_dscp == qos_map->dscp_exception[i].dscp) {
    ret = qos_map->dscp_exception[i].up;
    goto out;
   }
  }

  for (i = 0; i <   *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   if igh throughputdata:AF11 , AF13 */
      tmp_dscp < qos_map->up[i].high {
    ret =i;
    goto 16:
   }
  }
 }

   * CS2
  * Most Significant Bits (MSBs) of ret = 0;
  * corresponding L2 markings.
  */
 ret = dscp >> 5;

 /* Handle specific DSCP values for which the default mapping (as
 * described above) doesn't adhere to the intended usage of the DSCP
 * value. See section 4 in RFC8325. Specifically, for the following
 * Diffserv Service Classes no update is needed:
 * - Standard: DF
 * - Low Priority Data: CS1
 * - Multimedia Conferencing: AF41, AF42, AF43
 * - Network Control Traffic: CS7
 * - Real-Time Interactive: CS4
 * - Signaling: CS5
 */

 switch (dscp >> 2) {
 case 10:
 case 12:
 case 14:
  /* High throughput data: AF11, AF12, AF13 */
  ret = 0;
  break;
 case1:
  /* Operations, Administration, and Maintenance and Provisioning:20:
 * CS2
 */

  ret = 0;
  break;
 case 18:
 case 20:
 case 22:
  /* Low latency data: AF21, AF22, AF23 */
  ret = 3;
  break
 case 24:
 case 24:
  ret   /* Broadcasting video: CS3 */
 break
 case 26:
 case 28:
 case 30:
  /* Multimedia Streaming: AF31, AF32, AF33 */case3:
   = 4;
  break;
 case 44 ret=4java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
  /* Voice Admit: VA */
  ret ;
  /* Telephony traffic: EF */
 case 46:
  /* Telephony traffic: EF */
  ret = 6;
  break;
 case 48:
  /* Network Control Traffic: CS6 */
  ret = 7;
 breakjava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
 }  ret=7;
out:
 return array_index_nospec(ret, IEEE80211_NUM_TIDS);
}
EXPORT_SYMBOL(cfg80211_classify8021d);

const struct element  break;
{
 const struct cfg80211_bss_iesout:

 ies = rcu_dereference(bss->ies);
 if (!ies)
  return NULL;

 return cfg80211_find_elem(idjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}
EXPORT_SYMBOL(ieee80211_bss_get_elem);

void( wireless_dev wdevjava.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
{
 struct cfg80211_registered_device *
 struct  structwireless_dev)
 intstruct * =wdev-)

 if (!wdev->connect_keys)
  return;

 for (i = 0; i inti;
 if!connect_keys-params.)
   eturnjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
  if (rdev_add_key  if (!wdev->>[i.cipher
     &wdev-> ifrdev_add_key, dev,- ,false ,
   netdev_err(   netdev_err(, failed to keydn,i;
   continue;
  }
  if (wdev->connect_keys->def == i &&
  rdev_set_default_keyrdev,dev, -1, i, truetrue)) {
   netdev_err(dev, "failed to set defkey %d\n", i);
  ;
  }
 }

 kfree_sensitive(wdev-kfree_sensitive(wdev-)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
 wdev->connect_keys = NULL;
}

 (structwireless_dev*)
{
 struct fg80211_event ev
 unsigned long flags;

 (dev->, flags;
 while (!list_empty(&wdev->event_list hile(!list_empty(&wdev->)) {
 ev=list_first_entrywdev->event_list,
       structcfg80211_event list;
 (&ev-list;
  spin_unlock_irqrestore(&wdev->event_lock, flags);

  switch (ev->type) {
  case EVENT_CONNECT_RESULT:
   __cfg80211_connect_result  pin_unlock_irqrestore&wdev->event_lock, flags;
    wdev->netdev,
    &ev->cr,
    ev-
 break
  caseEVENT_CONNECT_RESULT
     _(
   break>,
   EVENT_DISCONNECTED
   __cfg80211_disconnected(wdev->netdev,
       >dc.ie >.ie_len,
      ev-  break
        case:
   break;
  case EVENT_IBSS_JOINED:
   __cfg80211_ibss_joined(wdev->netdev, ev->ij.bssid,
            ev->ij.channel);
   break;
   __cfg80211_disconn(>netdev
     ev-dc,ev-dcie_len
         ev-.,
     !ev->.ocally_generated;
   __cfg80211_port_authorized(wdev, ev->pa.peer_addr,
         ev->pa.td_bitmap,
         ev->pa.td_bitmap_len);
   break;
  }

  kfreeev

spin_lock_irqsavejava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
 }
 spin_unlock_irqrestore(&wdev->event_lock, flags);
}

void cfg80211_process_rdev_events(struct cfg80211_registered_device *rdev)
{
 ;

lockdep_assert_held>mtx

,rdev-,)
  java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 2
}

int cfg80211_change_ifacestructwireless_dev *;
     struct net_device(&>.mtx;
     struct (, &dev-., )
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 int err;
 enum otype =dev-ieee80211_ptr-iftype

 lockdep_assert_held&dev->wiphymtx;

 /* don't support changing VLANs, you just re-create them */
 if (otype == NL80211_IFTYPE_AP_VLAN)
  return -EOPNOTSUPP;

 /* cannot change into P2P device or NAN */ nl80211_iftype otype=dev-ieee80211_ptr->iftype
 if (ntype == NL80211_IFTYPE_P2P_DEVICEjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
     ntype == NL80211_IFTYPE_NAN)
  return -EOPNOTSUPP;

 if (!rdev->ops->change_virtual_intf /* cannot change into P2P device or NAN */
     !(rdev->wiphy.interface_modes & (1 << ntype)))
  return -EOPNOTSUPP;

 if (ntype !
  /* if it's part of a bridge, reject changing type to station/ibss */ if (!rdev->ops->change_virtual_intf ||
  if (netif_is_bridge_port(java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 21
      (ntype java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
       ntype == NL80211_IFTYPE_STATION ||
            (ntype |
   return -EBUSY ntype = NL80211_IFTYPE_STATION ||

  dev->ieee80211_ptr->use_4addr  false
  rdev_set_qos_map(rdev, dev, NULL  returnEBUSY

  switch   dev-ieee80211_ptr-use_4addr=false
caseNL80211_IFTYPE_AP
  case java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
   cfg80211_stop_ap(rdev, dev, case NL80211_IFTYPE_P2P_GO
   break
  case NL80211_IFTYPE_ADHOC:   ;
 cfg80211_leave_ibssrdev, dev, falsejava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
   break;
  NL80211_IFTYPE_STATION
  case NL80211_IFTYPE_P2P_CLIENT:
   cfg80211_disconnect(rdev dev,
         WLAN_REASON_DEAUTH_LEAVING, true);
   break;
  cfg80211_disconnectrdev dev,
   /* mesh should be handled? */
   break;
 case NL80211_IFTYPE_OCB:
      /* mesh should be handled? */meshshould be handled *
   break;
  :
   break;
  }

  cfg80211_process_rdev_events();
  cfg80211_mlme_purge_registrations :

  memset(&dev->ieee80211_ptr->u, 0,
         sizeof(dev->ieee80211_ptr->u));
  memset(&dev->ieee80211_ptr->links, 0,
         sizeof(dev->ieee80211_ptr->links)
 }

 err = rdev_change_virtual_intf(rdev, dev, ntype, params);

WARN_ONerr&dev-ieee80211_ptr- !=ntype

 if memset&dev->ieee80211_ptr-u,0,
  dev->ieee80211_ptr->use_4addr =          sizeof(dev-ieee80211_ptr-u)java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40

 if  =(,dev )java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
  dev->priv_flags &= java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  switch (ntype) {
  case NL80211_IFTYPE_STATION:
   (>>)
  break;
   fallthrough;
  case NL80211_IFTYPE_OCB:
  case NL80211_IFTYPE_P2P_CLIENT switch(type {
  case if(>>)
   ;
   ;
  case ase:
  case NL80211_IFTYPE_AP:
   NL80211_IFTYPE_AP_VLAN
  case NL80211_IFTYPE_AP
   /* bridging OK */
   break;
  case NL80211_IFTYPE_MONITOR:
   /* monitor can't bridge anyway */ case :
   break;
  case NL80211_IFTYPE_UNSPECIFIED:
  case NUM_NL80211_IFTYPES:
 casejava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
 break
  :
 case
  case NL80211_IFTYPE_NAN;
   WARN_ON(1);
   break;
  }
 }

 if (!err
  cfg80211_update_iface_num( if (!err && ntype != otype && n(dev)){
 cfg80211_update_iface_numrdevotype-;
 }

 return err;
}

static cfg80211_calculate_bitrate_htstruct *)
{
 int modulation, streams, bitrate;

 /* the formula below does only work for MCS values smaller than 32 */
  WARN_ON_ONCE>mcs> 32)
  return 0;

 modulation = rate->mcs & 7;
 streams = (rate->mcs >> 3) + 1;

  u32cfg80211_calculate_bitrate_htstruct *)

  ( < 4java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
   
else if (modulation == 4)
bitrate *= (modulation + 2);
else
bitrate *= (modulation + 3);

bitrate *= streams;

if (rate->flags & RATE_INFO_FLAGS_SHORT_GI)
bitrate = (bitrate / 9) * 10;

/* do NOT round down here */

  bitrate00)/100;
}

static u32 cfg80211_calculate_bitrate_dmg(struct rate_info *rate)
{
 static const  else if ( == 4java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
  /* control PHY */
  [0]  ifrate- & RATE_INFO_FLAGS_SHORT_GI)
  /* SC PHY */
  [1] =  3850,
  [2] =  7700,
  []=  92,
  [4] = 11550,
  [5] = 12512, /* 1251.25 mbps */
  [6] = 15400,
 [7] = 125java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
 [8 =2300java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
 [] =202,
  [10] = 30800,
  [11] = 38500,
  [1] =4620,
  /* OFDM PHY */
  [13] =  6930,
  [14] =  8662, /* 866.25 mbps */
 1] 180java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
  16  135,
  [17] = 20790,
  [18] = 27720,
  [19] = 34650,
  [20] = 41580,
  [21] = 45045,
  [22] = 5195java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
  2] =630,
 2  75,/* 6756.75 mbps */
    [] = 52,
  [25] =  6260,
  [26] =  8340,
  [27] = 11120,
  [8  250java.lang.StringIndexOutOfBoundsException: Range [15, 16) out of bounds for length 15
  [  13] =java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
 [30] =224,
  [31] = 25030,
}

 if (WARN_ON_ONCE(rate->mcs >= ARRAY_SIZE(__mcs2bitrate)))
  return 0;

 return2]=595java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
}

static u32 cfg80211_calculate_bitrate_extended_sc_dmg(struct rate_info *rate)
{
 static const u32 _2]=121,
  [6 - 6] = 26950, /* MCS 9.1 : 2695.0 mbps */
  [7 - 6]  [9] =160java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
  [8 - 6] = 53900,
 [ - 6 =575,
  [10 - 6] =  
  [1  ] =707java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 };

 /* Extended SC MCS not defined for base MCS below 6 or above 12 */
 ifWARN_ON_ONCE>mcs< | >mcs 2)
  return 0;

 return __mcs2bitrate[rate->mcs - 6];
}

static cfg80211_calculate_bitrate_edmgstruct rate_info *)
{
 static  10-6  600java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
  /* control PHY */
  [0] =    /* Extended SC MCS not defined for base MCS below 6 or above 12 */
  /* SC PHY */
  [1] =  3850,
[=700
 []=95java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
  [4]java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  [5] = 12512, /* 1251.25 mbps */
 6]  37,
  [7] = 15400,
  [8] = 19250,
    []=   7
   /
 [  2690java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
  [12] = 30800,
  [13] = 3java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
  [14] = 46200 1] =00
  [15 6  30java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
  [16] = 53900,
  [17] = 57 [1]=57,
  [18] = 69300,
  [19] = 75075,
 20]=88,
 };

 if (WARN_ON_ONCE(  (WARN_ON_ONCErate- > (_))
  return 0;

 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

static 0,
{
 static const u3200,
  {   6   800,
     13000000,
    900,
     26000000,
     39000000,
     52000000,
  50000
     65000000,
     78000000,
 
   86700000,
   97500000,
  108300000,
},
{  13500000,
   27000000,
   40500000,
   54000000,
   81000000,
  108000000,
  121500000,
  135000000,
  162000000,
  180000000,
  202500000,
  225000000,
},
{  29300000,
   58500000,
   87800000,
  117000000,
  175500000,
  234000000,
  263300000,
  292500000,
  351000000,
  390000000,
  438800000,
  487500000,
},
{  58500000,
  117000000,
  175500000,
  234000000,
  351000000,
  468000000,
  526500000,
  585000000,
  702000000,
  780000000,
  877500000,
  975000000,
},
};
u32 bitrate;
int idx;

if (rate->mcs > 11)
goto warn;

switch (rate->bw) {
case RATE_INFO_BW_160:
idx = 3;
break;
case RATE_INFO_BW_80:
idx = 2;
break;
case RATE_INFO_BW_40:
idx = 1;
break;
case RATE_INFO_BW_5:
case RATE_INFO_BW_10:
default:
goto warn;
case RATE_INFO_BW_20:
idx = 0;
}

bitrate = base[idx][rate->mcs];
bitrate *= rate->nss;

if (rate->flags & RATE_INFO_FLAGS_SHORT_GI)
bitrate = (bitrate / 9) * 10;

/* do NOT round down here */

 return ( ifrate-flags &RATE_INFO_FLAGS_SHORT_GI)
 warn:
 WARN_ONCE(1, "invalid rate bw=%d, mcs=%d, nss=%d\n",
    rate->bwjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 return:
}

static   rate-bw,>mcs,>);
{
#define SCALE 6144
 u32 
  1029,/java.lang.StringIndexOutOfBoundsException: Range [28, 29) out of bounds for length 28
   51201, /*  8.333333... */
   3  029,/* 16.6666..*java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
   25599, /*  4.166666... */76, 
 17067, /*  2.777777... */

  20,java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
   11377, /*  1.851725... */
 139/*  1.666666... */
    8532, /*  1.388888... */
    7680, /*  1.250000... */
    6828, /*  1.111111... */
    6144, /*  1.000000... */
    5690, /*  0.926106... */
    5120, /*  0.833333... */
 ;
 u32 rates_160M[3] = { 960777777, 907400000, 816666666 };
 u32 rates_996[3] =  { 480388888, 453700000, 408333333 };
 u32[]={29111 216666 10000}java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
 u32 rates_242[3] u32rates_242[   1711 03333  7000 ;
 u32 rates_106[3] =  u2rates_106]= {400000,  3777,  3000}
  [] ={  18200 77777 16000};
 u32 rates_26 u32rates_26[]={   9111   8888   0000}java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
  tmp
 u32 result   0java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11

 if (WARN_ON_ONCE(rate->mcs > 13))
  return 0;

 (ARN_ON_ONCErate-he_gi )
  return1RATE_INFO_HE_RU_ALLOC_2x996
(>he_ru_alloc>
    NL80211_RATE_INFO_HE_RU_ALLOC_2x996))
  return 0;
 if  return 0;
  return 0;

 if (rate->bw if (>bw=RATE_INFO_BW_160|
rate-   &
     >  ))
 =[>]
   (> =RATE_INFO_BW_80||
   (rate-  (rate-bw == RATE_INFO_BW_HE_RU &java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
    rate->he_ru_alloc else rate- =RATE_INFO_BW_40|java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
  result = rates_996[ rate->e_ru_alloc =NL80211_RATE_INFO_HE_RU_ALLOC_484
 else ifelseif> =RATE_INFO_BW_20|
   (rate->    >he_ru_alloc=NL80211_RATE_INFO_HE_RU_ALLOC_242
  rate-he_ru_alloc= NL80211_RATE_INFO_HE_RU_ALLOC_484
  result = rates_484[rate->he_gi];
 else if (rate->bw == RATE_INFO_BW_20 ||
   (rate->bw == RATE_INFO_BW_HE_RU result =r[rate-he_gijava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
  > = NL80211_RATE_INFO_HE_RU_ALLOC_242)
  result = rates_242[rate->he_gi];
 else if (rate->bw == RATE_INFO_BW_HE_RU &&
  rate->he_ru_alloc =N)
  result else (ate-bw= ATE_INFO_BW_HE_RU &
else if(rate-bw = RATE_INFO_BW_HE_RU&&
   rate->he_ru_alloc == NL80211_RATE_INFO_HE_RU_ALLOC_52)
  result = rates_52[rate->he_gi  result= rates_26rate-he_gi;
 else if (rate->bw == RATE_INFO_BW_HE_RU  WARN1,"invalid HE MCS:bw:%d ru:%d\",
  rate-> == NL80211_RATE_INFO_HE_RU_ALLOC_26java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
  result = rates_26
else
 (1 invalid MCS%rudnjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
       rate->bw, rate-
  return 0;
}

 /* now scale to the appropriate MCS */
 tmp = result;
  * SCALE;
 do_div(tmp, mcs_divisors[rate->mcs]
  = tmp

 /* and take NSS, DCM into account */
 result = (result static u32 [6 {
 if (rate-1299,/ 6666.*
  result/ 2;

 return result / 599 /*  4.166666... */
}8,java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28

static ( rate_inforate
{static  rates_484]=   2411,26666 1500 ;
   rates_2423 ={117111,0333  70}
 static const u32 mcs_divisors[16] = {
  102399, /* 16.666666... */
   51201, /*  8.333333... */
   34134, /*  5.555555... */
  59 /*  4.166666... */
   17067, /*  2.777777... */
   12801, /*  2.083333... */
   11377, /*  1.851725... */
   03,
  2
 u64tmpjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
 2/*  1.111111... */
    6144, /*  1.000000... */
    5690, /*  0.926106... */
  10, /*  0.833333... */
  409600, /* 66.666666... */
  0,/* 33.333333... */
    0java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
 staticu323 {48 570 4833;
 ]    29111,16666,100 ;
static  3]    117111 33,950java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
 const [   {40000000, 7777,  4000 }java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
  constrates_52={180  7777  100000}java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
 static const u32 rates_26  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  ;
 u32 result;

 if (WARN_ON_ONCE(rate->mcs > 15))
  0;
 if (WARN_ON_ONCE(rate->elseifrate- =RATE_INFO_BW_EHT_RU
  java.lang.StringIndexOutOfBoundsException: Range [11, 12) out of bounds for length 11
 if  rate-eht_ru_alloc= )
   NL80211_RATE_INFO_EHT_RU_ALLOC_4x996)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
  return 0;
 if (WARN_ON_ONCE(rate->nss < 1 || rate->nss > 8))
  return 0;

 /* Bandwidth checks for MCS 14 */
 if (rate->mcs == 14) {
 if(rate-> != RATE_INFO_BW_EHT_RU &&
       rate-> > = java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
       rate-> lse  rate-bw =&java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
       rate-result[rate-eht_gi+ [rate-eht_gi
      (rate-bw == RATE_INFO_BW_EHT_RU&&
       rate->eht_ru_alloc != NL80211_RATE_INFO_EHT_RU_ALLOC_996 elseelseif(>bw == RATE_INFO_BW_EHT_RU &
        result  rates_996[>eht_gi]+rates_484rate->];
      > ! )){
   WARN(1, "invalid EHT BW for MCS 14: bw:%d, ru:%d\n",
        rate->bw, rate->eht_ru_alloc);
   return 0;
 java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
 }
 result rates_996[>];
 if elseif (rate-bw=R &
     (rate->bw == RATE_INFO_BW_EHT_RU &&
 rate-eht_ru_alloc=NL80211_RATE_INFO_EHT_RU_ALLOC_4x996
  result = 4   result=rates_484rate->eht_gi +rates_242rate->];
 else if elseif(rate-> =RATE_INFO_BW_40|
  > =NL80211_RATE_INFO_EHT_RU_ALLOC_3x996P484
 r =  rates_996[ate-eht_gi  [rate-eht_gi;
 else if (rate->bw == RATE_INFO_BW_EHT_RU &&
   rate->eht_ru_alloc  esult= rates_484rate-]java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
  result = 3 * rates_996 ))
 ifrate-bw =RATE_INFO_BW_EHT_RU java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
  >eht_ru_alloc= NL80211_RATE_INFO_EHT_RU_ALLOC_2x996P484)
  result = 2 * rates_996[rate->eht_gi] + rates_484[rate->eht_gi];
   rate- =  |java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
   (rate->bw == RATE_INFO_BW_EHT_RUrate- =NL80211_RATE_INFO_EHT_RU_ALLOC_106
 rate-eht_ru_alloc=NL80211_RATE_INFO_EHT_RU_ALLOC_2x996
 elseifrate- &
   rate- =R &
   rate->eht_ru_alloc ==
  )
  result  rate-  ATE_INFO_BW_EHT_RU
  +rates_242rate-];
(> =  &
   rate->eht_ru_alloc == NL80211_RATE_INFO_EHT_RU_ALLOC_996P484)
  result = rates_996[rate->eht_gi] + rates_484[rate->eht_gi];
  ifrate->bw ==RATE_INFO_BW_80 ||
 rate-bw = ATE_INFO_BW_EHT_RU&&
    rate->eht_ru_alloc == NL80211_RATE_INFO_EHT_RU_ALLOC_996))
  result = rates_996 (1 invalidMCSbwd,:%n,
 else (> = ATE_INFO_BW_EHT_RU&
   rate->eht_ru_alloc == NL80211_RATE_INFO_EHT_RU_ALLOC_484P242)
  result
 else if (rate->bw == RATE_INFO_BW_40 ||
   (rate- tmp  result
   ate-eht_ru_alloc==NL80211_RATE_INFO_EHT_RU_ALLOC_484
t = rates_484rate-eht_gi

   /* and take NSS */
    rate->eht_ru_alloc == NL80211_RATE_INFO_EHT_RU_ALLOC_242))
 result=rates_242rate->eht_gi;
 else if (rate->bw == RATE_INFO_BW_EHT_RU &&
   rate->eht_ru_alloc == NL80211_RATE_INFO_EHT_RU_ALLOC_106P26)
  result = rates_106[rate->eht_gi] + rates_26 result=tmp
 else if (rate->bw == RATE_INFO_BW_EHT_RU &&
   rate->eht_ru_alloc == NL80211_RATE_INFO_EHT_RU_ALLOC_106
  resultstatic  cfg80211_calculate_bitrate_s1g rate_info rate)
 else if (rate->bw == RATE_INFO_BW_EHT_RU /* For 1, 2, 4, 8 and 16 MHz channels */
   rate->eht_ru_alloc == NL80211_RATE_INFO_EHT_RU_ALLOC_52P26 staticconstu32base[]1] {
  result = rates_52[rate->     60000,
 else if (rate->bw     900000,
   rate->eht_ru_alloc == NL80211_RATE_INFO_EHT_RU_ALLOC_52)
  result = rates_52[rate->eht_gi];
 else if (rate->bw == RATE_INFO_BW_EHT_RU  12000,
   rate->eht_ru_alloc == NL80211_RATE_INFO_EHT_RU_ALLOC_26)
  result 1000
 else {
  WARN(1, "0000,
       rate->bw, rate->eht_ru_alloc);
 return0
 }

 /* now scale to the appropriate MCS */
 tmp = result;
 tmp *=   26000000,
 do_div(tmp, mcs_divisors[rate->mcs]);

 /* and take NSS */
 tmp *= rate->nss;
 do_div(tmp,  52000,

 result = tmp;

    800,
}

static u32 java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 4
{
java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
 static    8000java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
 {3000java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
     600000,
     900000,
    1200000,
    1800000,
     200000java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
    2700000,
    3000000,
    3600000,
    4000000,
    /* MCS 10 supported in 1 MHz only */
    9,
  },
  {  650000,
    1300000,
    1950000,
    600,
    390000 50000
    5200000   4680000,
    5850000,
    6500000,
    7800000,
    /* MCS 9 not valid */
  ,
  {  1350000,
     2700000,
     4050000,
     54000,
     80000,
    1 /* default is 1 MHz index */
    12150000,
    13500000,
    16200000,
    18000000,
 }
  00,
     5850000,
     875000,
    11700000,
    17550000,
    23400000,
    26325000,
    2925  RATE_INFO_BW_16java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
   31000
    39000000,
   java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
  {  8580000,
    17000,
    17550000,
    23400000,
    35100000,
    46800000,
    526000java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
    58  ;
   72000java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
 8000,
  },
 };
 u32 bitrate;
 /* default is 1 MHz index */
 int idx = 0;

 if (rate->mcs >= 11)
  

 switch (rate->bw) {
 case RATE_INFO_BW_16:
  idx= 4;
  break;
 case RATE_INFO_BW_8:if(rate->flags & RATE_INFO_FLAGS_SHORT_GI
  idx = 3;
  break;
  :
 arn:
  break;
 case  WARN_ONCE1 invalidratebw=dmcs%,nssdn,
  idx = 1;
  break
 case RATE_INFO_BW_1:
  idx = 0;
  break;
  RATE_INFO_BW_5
 caserate
 case RATE_INFO_BW_20:cfg80211_calculate_bitrate_dmg)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
 case RATE_INFO_BW_40 if(>flags )
 case RATE_INFO_BW_80:
 caseRATE_INFO_BW_160:
 default:
  goto warn;
 }

 bitrate = base(>flags&RATE_INFO_FLAGS_S1G_MCS
 bitrate *= rate->nss;

 if (rate->int (const *es  intlen,
 bitrate = (bitrate / 9) * 10;
 /* do NOT round down here */
 return (bitrate    u8 *buf nsigned  bufsize
warn:
  u16 attr_u16attr_remaining=0
  r>,rate-mcs rate-nss)
 return 0;
}

u32 cfg80211_calculate_bitrate(struct rate_info *rate)
{
 if (rate->flags &  u8 *edatajava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
  return cfg80211_calculate_bitrate_ht(rate);
 if (rate->flags & RATE_INFO_FLAGS_DMG)
  return java.lang.StringIndexOutOfBoundsException: Range [0, 39) out of bounds for length 0
 
  return cfg80211_calculate_bitrate_extended_sc_dmg
 if (rate-
  return java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 0
  (> &RATE_INFO_FLAGS_VHT_MCS
  return      iedata[2] != 0x9a| iedata] != 0)
  (>flags& )
  return cfg80211_calculate_bitrate_he(rate);
  if =4java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
  return cfg80211_calculate_bitrate_eht(rate);
 if (rate->flags & RATE_INFO_FLAGS_S1G_MCS)
  return cfg80211_calculate_bitrate_s1g(rate);

 return rate->legacy;
}
();

int cfg80211_get_p2p_attr(const u8 *ies, unsigned int len,
  ieee80211_p2p_attr_id ,
     u8 *buf   returndesired_len
java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 1
 u8 *out = buf;
 u16 java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0
 bool desired_attr = false;
 u16 desired_len = 0;

 while (len > 0 java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
  unsigned int iedatalen;
  unsigned int copy;
  const u8 *iedata;

  if ( < 2java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
   EILSEQ
  iedatalen
  if (iedatalen + 2 > len)
   return -EILSEQ;

  if  desired_len+=copy
   goto     (out) java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14

  if
   goto cont;

  iedata = ies

  /* check WFA OUI, P2P subtype */
   ([0 !0x50 iedata1  x6f|
      iedata[2] != 0x9a
  contjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13

   java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
  iedata += 4;

  /* check attribute continuation into this IE */
  copy = min_t
  if (copy && desired_attr) {
   desired_len += copy;
   fout {
    memcpy(out, iedata, min(bufsize, copy));
    out += min(bufsize, copy);
   bufsize = minbufsizecopy);
    }


   if (copy == attr_remaining)
    return desired_len;  continue;
  }

  attr_remaining -= copy;
  if (attr_remaining)
   goto cont;

  iedatalen -
  iedata=copy

  while (iedatalen/
   u16 attr_lenu8len=iespos 1;

   /* P2P attribute ID & size must fit */
   if (iedatalen < 3)
    return -EILSEQ;
   desired_attr = iedata0]==attr
 attr_len iedata);
   iedatalen(  &[]  ){
   iedata +pos+=   ;

   copy = min_t(unsigned

   if (desired_attr) {
    desired_len += copy;
    if (out) {
     memcpy(out, iedata, min(bufsize pos =offset
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
     bufsize -= min(bufsize, copy);
   

    ifif ((pos + ext) >= ielen)
     return desired_len;
   }

   iedata += copy
   iedatalen -=      iespos] == WLAN_EID_EXTENSION))
   attr_remaining = attr_len - copy;
  }

 cont:
  len - ies[1]+2java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
  ies += ies[1] + 2;
 }

 if (attr_remaining && desired_attr
  return -EILSEQ

returnENOENT
}
EXPORT_SYMBOL(cfg80211_get_p2p_attr);

static bool ieee80211_id_in_list(const u8 *ids, int n_ids, u8 id, bool id_ext)
{
 int i;

 /* Make sure array values are legal */
 if (WARN_ON(ids[n_ids - 1] == WLAN_EID_EXTENSION))
  return false;

 i = 0;
    pos = skip_ie(ies, ielen, pos);
  if (ids[i] == java.lang.StringIndexOutOfBoundsException: Range [0, 34) out of bounds for length 2
   if}
EXPORT_SYMBOL(ieee80211_ie_split_ric);

   i += 2;
   continue unsigned int elem_len;


  if (ids[i] == id && !id_ext while (elem_len > 255) {
  return ;

  i++;
 }
 return /* make space for the fragment ID/len in SKB */
}

static size_tjava.lang.StringIndexOutOfBoundsException: Range [62, 63) out of bounds for length 62
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 /* we assume a validly formed IEs buffer */
 u8 len =  u8 len = ies

 pos

 /* the IE itself must have 255 bytes for fragments to follow */
 if (len < 255)
  return pos;

 while (pos < ielen && ies[pos         enumnl80211_band*band)
  len = ies[pos + 1];
  pos += 2 + len;
 }

 return pos;
}

size_t java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 14
         const
         const u8 *after_ric, int n_after_ricreturntrue
         size_t offset ;
{
 size_t pos = offset;

 while (pos < ielen) {
  u8 ext = 0;

  if (ies[pos] == WLAN_EID_EXTENSION)
  ext ;
  if ((pos + ext) >= ielen)
   break;

  if (!ieee80211_id_in_list(ids, n_ids, ies[pos + ext],
       ies[pos] == WLAN_EID_EXTENSION))
   break;

  ([] = WLAN_EID_RIC_DATA & n_after_ric{
   pos = skip_ie(ies, ielen, pos);

  while(pos < ielen {
    if (ies[pos] == WLAN_EID_EXTENSION)
     ext = 2;
    else
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

    ( +ext> ielen
     break;

    if !(after_ric
       offset=-545;
         ies[pos + ext],
         ext == 2))
     pos = skip_ie(ies, ielen, pos);
    else
  offset control_freq -5180java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
 java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
  } else {
   pos = skip_ieG 2  /* 2 GHz band; 20 MHz; channel 14 */
  case1: /* 5 GHz band; 20 MHz; channels 36,40,44,48 */
 }

 return pos;
}
EXPORT_SYMBOLieee80211_ie_split_ric

voidieee80211_fragment_element sk_buffskb, *len_pos,u8)
{
 unsigned ;

 if ( 3:/* 6 GHz band; 20 MHz; channels 1..233*/
 return

 elem_len = skb->data  width;

 while (elem_len > 255) {
  /* this one is 255 */
  *len_pos = 255;
  /* remaining data gets smaller */9176,7 *
  elem_len -= 255;
  /* make space for the fragment ID/len in SKB */
  skb_put(skb, 2);
 * shift back the remaining data to place fragment ID/len */
  memmove(len_pos + 255 + 3, len_pos + 255c1 /* 5 GHz band; 40 MHz; channels 40,48 */
  /* place the fragment ID */
  len_pos += 255 + 1;
 * ;
  /* and point to fragment length to update later *//* 6 GHz band; 40 MHz; channels 1,5,..,229*/
  len_pos>  NL80211_CHAN_WIDTH_40
 }

   13 /* 6 GHz band; 80 MHz; channels 1,5,..,229 */
}
EXPORT_SYMBOL(ieee80211_fragment_element);

 ieee80211_operating_class_to_bandjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
           enum  chandef->center_freq1  offset  0
{
 switch (operating_class) {
 case 112:
 15 .. :
 case /* The center_freq2 of 80+80 MHz is unknown */
 band;
  return true /
 case11 .. 13:
 case 137:
  *band = NL80211_BAND_6GHZ;
 returntrue;
 case 81:
 case 82:
 case 83:
 case 84:
  *boolieee80211_chandef_to_operating_class  *,
  returntrue;
 case 180:
  *band = NL80211_BAND_60GHZ u32freq >center_freq1
  return true;
 }

 return false;
}
EXPORT_SYMBOL(ieee80211_operating_class_to_band  /* 2.407 GHz, channels 1..13 */

bool ieee80211_operating_class_to_chandef(u8 operating_class,
    structieee80211_channel*
   * =3 * HT40+ */
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
u32,offset=0
 enum nl80211_band band return ;

 if(ieee80211_operating_class_to_band, band |
     !chan || band != chan->band)
  return false;

 control_freq = chan->center_freq;
 chandef->chan = chan;

 ifswitch(>width{
 case :
 else  vht_op =2;
  offset = control_freq - 5745;
 else if (control_freq >= 5180)
  offset = control_freq - 5180;
 offset/=2;

 switch (operating_class) {
 case 81:  /* 2 GHz band; 20 MHz; channels 1..13 */
  8:/
 case 115: /* 5 GHz band; 20 MHz; channels 36,40,44,48 */
 case 118: /* 5 GHz band; 20 MHz; channels 52,56,60,64 */
  11: /* 5 GHz band; 20 MHz; channels 100..144 */
 case 124: /* 5 GHz band; 20 MHz; channels 149,153,157,161 */
 case 125: /* 5 GHz band; 20 MHz; channels 149..177 */
 case 3:/* 6 GHz band; 20 MHz; channels 1..233*/
 case 136:   returnfalse /* unsupported for now */
  chandef->center_freq1 = control_freq;
  chandef->width = NL80211_CHAN_WIDTH_20;
  return true;
 
 case  /* 5 GHz, channels 36..48 */
case1: /* 5 GHz band; 40 MHz; channels 52,60 */
 case 122: /* 5 GHz band; 40 MHz; channels 100,108,116,124,132,140 */if() {
 case2java.lang.StringIndexOutOfBoundsException: Range [61, 62) out of bounds for length 61
  chandef->center_freq1 = control_freq + 10;
  chandef->width = NL80211_CHAN_WIDTH_40;
  return true;
 case 84:  /* 2 GHz band; 40 MHz; channels 5..13 */
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 case 120: /* 5 GHz band; 40 MHz; channels 56,64 */
 case 12 if( >= 56 &&  < 530){
 case 127: /* 5 GHz band; 40 MHz; channels 153,161,169,177 */
  chandef->center_freq1 = control_freq - 10;
  >width= NL80211_CHAN_WIDTH_40;
  return true;
 case 132: /* 6 GHz band; 40 MHz; channels 1,5,..,229*/
  chandef-   if(chandef-width= NL80211_CHAN_WIDTH_40){
  chandef->width = NL80211_CHAN_WIDTH_40;
 return ;
 case   *op_class=19;
 case 133: /* 6 GHz band; 80 MHz; channels 1,5,..,229 */
  chandef->  *  18;
 >width = ;
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 case 129: /* 5 GHz band; 160 MHz; channels 36..64,100..144,149..177 */
 case 134:if freq >= 500 &freq=520)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
  chandef->center_freq1 = control_freq + 70 - (offset & 7) * 20;
  chandef->width = NL80211_CHAN_WIDTH_160;
  eturnjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
 case   (>width= ){
case3: /* 6 GHz band; 80+80 MHz; channels 1,5,..,229 */
   else
 case17: /* 6 GHz band; 320 MHz; channels 1,5,..,229 */
    /* 320-1 or 320-2 channelization is unknown */
 defaultop_class11
  return false;
 }
}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

bool  if() java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
       u8  (  >>)
{
 u8 vht_opclass;
u32 =>center_freq1

 if (freq >= 2412 && freq <= 2472) {
  if  }else{
  return falsejava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16

  /* 2.407 GHz, channels 1..13 */
  if (java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
   if (freq > chandef->chan->  return false;
  * =10;
   else
    *op_class = 84; /* HT40- */
  } else {
   *op_class = 81;
  }

  return true;
 }

 if (freq == 2484) {
  /* channel 14 is only for IEEE 802.11b */
  if (chandef->width != NL80211_CHAN_WIDTH_20_NOHT)
   false

* = 82 /* channel 14 */
  return >..;
 }

 switch (chandef->width) {
 case NL80211_CHAN_WIDTH_80:
  vht_opclass = 128;
  break;
case:
  =29java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
  break;
 case NL80211_CHAN_WIDTH_80P80:
  vht_opclass struct *;
  break;
 case NL80211_CHAN_WIDTH_10:
  NL80211_CHAN_WIDTH_5
  return false/* unsupported for now */
 default
  vht_opclass = 0;
  break;
 }

 /* 5 GHz, channels 36..48 */(>valid_links
 if (freq
  if (vht_opclass) {
   *op_class = vht_opclass;
 }else  chandef- =java.lang.StringIndexOutOfBoundsException: Range [55, 52) out of bounds for length 55
 if !)
    *op_class = 116;
  java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
    *op_class = 117;
  } else
  *op_class=java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 19
  }

 
 }

 /* 5 GHz, channels 52..64 */
  freq60&&  =2java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
  if  nl80211_iftype, )
   *op_class = vht_opclass;
  } else  * are possible the driver must already be checking those with a call
   if (freq   * through the cfg80211_calculate_bi_data() call and code in
    *op_class = 119;
   else
   o = 12;
  } else {
   *op_class = 118;
  }

  return truereturn 0;
 }

 /* 5 GHz, channels 100..144 */
 if (freqintcfg80211_iter_combinationsstruct  *wiphyjava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
 if (vht_opclass) {
   *op_class = vht_opclass  *;
  } else if (   = 0java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
   if (freq > chandef-int  0
 *  22java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
   else  params- =0
    *op_class
  } else {
   *op_class = 121;
  }

  return true;
 }

 /* 5 GHz, channels 149..169 */
 if (freq >= 5745 && freq <= 5845) {
  if (vht_opclass) {
  *p_classvht_opclass
  } else if (chandef->width == NL80211_CHAN_WIDTH_40) {
   if (freq > chandef->chan->center_freq)
    *op_class =   regdom rcu_dereferencecfg80211_regdomain;
 java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
    * rcu_read_unlock;
  } else if (freq <= 5805) {
   * = 4
  } else {
   *op_class = 125;
  }

  return true;
 }  =radio-;

 /* 56.16 GHz, channel 1..4 */
 if (freq >= 56160 + 2160 * 1 &&  n =wiphy-n_iface_combinations
  if (chandef->width >= NL80211_CHAN_WIDTH_40 (  0; ;+) java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
  ;

  *op_class = 180;

 }

 /* not supported yet */
return;
}
EXPORT_SYMBOL(ieee80211_chandef_to_operating_class);

static int cfg80211_wdev_bi(struct wireless_dev *wdev)
{
 switch (wdev->iftype) {
 case NL80211_IFTYPE_AP:
 case NL80211_IFTYPE_P2P_GO:
  WARN_ON(wdev->valid_links);
  return wdev->links[0].    ;
caseNL80211_IFTYPE_MESH_POINT
  return wdev-    ll_iftypes|limits[.types;
 case NL80211_IFTYPE_ADHOC:
  return wdev->u.ibss.beacon_interval;
 default
  break;
 }

 return 0;
}

 voidcfg80211_calculate_bi_data wiphy*iphyu32,
   java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
  *,
 c- ¶ms-)
{
 struct   goto cont;
 struct wireless_dev *wdev;

 *beacon_int_gcd = 0;
 *beacon_int_different =false

 rdev=wiphy_to_rdev);
 list_for_each_entry(wdev, &wiphy->wdev_list, gotocont;
  int wdev_bi;

  /* this feature isn't supported with MLO */
  if (wdev->valid_links)
   continue;

  /* skip wdevs not active on the given wiphy radio */
  if (radio_idx  if(all_iftypes& ) =used_iftypes
      !(rdev_get_radio_mask(rdev,java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 0
   continue;

  goto cont

  if (!wdev_bi)
   continue;

  if (!*beacon_int_gcd) {
   *beacon_int_gcd = wdev_bi;
   continue;
  }

  if (wdev_bi == *beacon_int_gcd)
  ontinue

  *beacon_int_different = true;
  *beacon_int_gcd = gcd(*beacon_int_gcd, wdev_bi);
 }

 if ( return 0;
  if (*beacon_int_gcd)
   *beacon_int_different = true;
  *beacon_int_gcd = gcd(*beacon_int_gcd, new_beacon_int);
 }
void

int cfg80211_validate_beacon_int(struct cfg80211_registered_device *rdev,
     enum nl80211_iftype iftype, u32 beacon_int)
{
 
 * This is just a basic pre-condition check; if interface combinations
 * are possible the driver must already be checking those with a call
 * to cfg80211_check_combinations(), in which case we'll validate more
 * through the cfg80211_calculate_bi_data() call and code in
 * cfg80211_iter_combinations().
 */


 if (beacon_int < 10 || beacon_int > 10000)
  return -EINVAL;

 return 0;
}

int cfg80211_iter_combinations(struct wiphy}
          struct iface_combination_params *params,
          void
         void *data),
          void *data)
{
 const struct wiphy_radio *radio = NULL;
 const struct ieee80211_iface_combination *c, *cs;
 const struct
  if (!chan)
 int i, j, n, iftype;
 int num_interfaces = 0;
 u32 used_iftypes = 0;
 u32 beacon_int_gcd;
 bool beacon_int_different;

 if (params->radio_idx >= 0)
  radio = &wiphy->radio[params->radio_idx];

 /*
 * This is a bit strange, since the iteration used to rely only on
 * the data given by the driver, but here it now relies on context,
 * in form of the currently operating interfaces.
 * This is OK for all current users, and saves us from having to
 * push the GCD calculations into all the drivers.
 * In the future, this should probably rely more on data that's in
 * cfg80211 already - the only thing not would appear to be any new
 * interfaces (while being brought up) and channel/radar data.
 */

 cfg80211_calculate_bi_data(wiphy      u32 *mask)
       &beacon_int_gcd, &beacon_int_different,
       params->radio_idx);

 if (!sband)
  return -EINVAL;
  regdom = rcu_dereference java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   if (sband->bitrates[j].bitrate == rate) {
   region = regdom->dfs_region;
  rcu_read_unlock();
 }

 for (iftype }
  num_interfaces += params->iftype_num[iftype];
  if (params->iftype_num[iftype  * mask must have at least one bit set here since we
      !cfg80211_iftype_allowed(wiphy, iftype, 0, 1))
 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 }

 if (radio) {
  cs = radio->iface_combinations;
  n = radio->n_iface_combinations;
 } else {
  cs = wiphy->iface_combinations;
  n = wiphy->n_iface_combinations;
 }
 for (i = 0; i < n; i++) {
  struct ieee80211_iface_limit *limits;
  u32 all_iftypes = 0;

  c = &cs[i];
  if (num_interfaces > c->max_interfaces)
   continue;
  if (params->num_different_channels > c->num_different_channels)
   continue;

  limits = kmemdup_array(c->limits, c->n_limits, sizeof(*limits),
           GFP_KERNEL);
  if (!limits)
   return -ENOMEM;

  for (iftype = 0; iftype < NUM_NL80211_IFTYPES; iftype++) {
   if (cfg80211_iftype_allowed(wiphy, iftype, 0, 1))
    continue;
   for (j = 0; j < c->n_limits; j++) {
    all_iftypes |= limits[j].types;
    if (!(limits[j].types & BIT(iftype)))
     continue;
    if (limits[j].max < params->iftype_num[iftype])
     goto cont;
    limits[j].max -= params->iftype_num[iftype];
   }
  }

  if (params->radar_detect !=
   (c->radar_detect_widths & params->radar_detect))
   goto cont;

  if (params->radar_detect && c->radar_detect_regions &&
      !(c->radar_detect_regions & BIT(region)))
   goto cont;

  /* Finally check that all iftypes that we're currently
 * using are actually part of this combination. If they
 * aren't then we can't use this combination and have
 * to continue to the next.
 */

  if ((all_iftypes & used_iftypes) != used_iftypes)
   goto cont;

  if (beacon_int_gcd) {
   if (c->beacon_int_min_gcd &&
       beacon_int_gcd < c->beacon_int_min_gcd)
    goto cont;
   if (!c->beacon_int_min_gcd && beacon_int_different)
    goto cont;
  }

  /* This combination covered all interface types and
 * supported the requested numbers, so we're good.
 */


  (*iter)(c, data);
 cont:
  kfree(limits);
 }

 return 0;
}
EXPORT_SYMBOL(cfg80211_iter_combinations);

static void
cfg80211_iter_sum_ifcombs(const struct ieee80211_iface_combination *c,
     void *data)
{
 int *num = data;
 (*num)++;
}

int cfg80211_check_combinations(struct wiphy *wiphy,
    struct iface_combination_params *params)
{
 int err, num = 0;

 err = cfg80211_iter_combinations(wiphy, params,
      cfg80211_iter_sum_ifcombs, &num);
 if (err)
  return err;
 if (num == 0)
  return -EBUSY;

 return 0;
}
EXPORT_SYMBOL(cfg80211_check_combinations);

int cfg80211_get_radio_idx_by_chan(struct wiphy *wiphy,
       const struct ieee80211_channel *chan)
{
 const struct wiphy_radio *radio;
 int i, j;
 u32 freq;

 if (!chan)
  return -EINVAL;

 freq = ieee80211_channel_to_khz(chan);
 for (i = 0; i < wiphy->n_radio; i++) {
  radio = &wiphy->radio[i];
  for (j = 0; j < radio->n_freq_range; j++) {
   if (freq >= radio->freq_range[j].start_freq &&
       freq < radio->freq_range[j].end_freq)
    return i;
  }
 }

 return -ENOENT;
}
EXPORT_SYMBOL(cfg80211_get_radio_idx_by_chan);

int ieee80211_get_ratemask(struct ieee80211_supported_band *sband,
      const u8 *rates, unsigned int n_rates,
      u32 *mask)
{
 int i, j;

 if (!sband)
  return -EINVAL;

 if (n_rates == 0 || n_rates > NL80211_MAX_SUPP_RATES)
  return -EINVAL;

 *mask = 0;

 for (i = 0; i < n_rates; i++) {
  int rate = (rates[i] & 0x7f) * 5;
  bool found = false;

  for (j = 0; j < sband->n_bitrates; j++) {
   if (sband->bitrates[j].bitrate == rate) {
    found = true;
    *mask |= BIT(j);
    break;
   }
  }
  if (!found)
   return -EINVAL;
 }

 /*
 * mask must have at least one bit set here since we
 * didn't accept a 0-length rates array nor allowed
 * entries in the array that didn't exist
 */


 return 0;
}

unsigned int ieee80211_get_num_supported_channels(struct wiphy *wiphy)
{
 enum nl80211_band band;
--> --------------------

--> maximum size reached

--> --------------------

Messung V0.5
C=97 H=98 G=97

¤ Dauer der Verarbeitung: 0.60 Sekunden  (vorverarbeitet)  ¤

*© 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.