1*5113495bSYour Name /* 2*5113495bSYour Name * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved. 3*5113495bSYour Name * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. 4*5113495bSYour Name * 5*5113495bSYour Name * Permission to use, copy, modify, and/or distribute this software for any 6*5113495bSYour Name * purpose with or without fee is hereby granted, provided that the above 7*5113495bSYour Name * copyright notice and this permission notice appear in all copies. 8*5113495bSYour Name * 9*5113495bSYour Name * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10*5113495bSYour Name * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11*5113495bSYour Name * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12*5113495bSYour Name * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13*5113495bSYour Name * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14*5113495bSYour Name * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15*5113495bSYour Name * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16*5113495bSYour Name */ 17*5113495bSYour Name 18*5113495bSYour Name /** 19*5113495bSYour Name * DOC: Contains mandatory API from legacy 20*5113495bSYour Name */ 21*5113495bSYour Name 22*5113495bSYour Name #ifndef _WLAN_UTILITY_H_ 23*5113495bSYour Name #define _WLAN_UTILITY_H_ 24*5113495bSYour Name 25*5113495bSYour Name #include <qdf_types.h> 26*5113495bSYour Name #include <wlan_objmgr_psoc_obj.h> 27*5113495bSYour Name #include <wlan_objmgr_pdev_obj.h> 28*5113495bSYour Name #include <wlan_objmgr_vdev_obj.h> 29*5113495bSYour Name 30*5113495bSYour Name #define TGT_INVALID_SNR (0) 31*5113495bSYour Name #define TGT_MAX_SNR (TGT_NOISE_FLOOR_DBM * (-1)) 32*5113495bSYour Name #define TGT_NOISE_FLOOR_DBM (-96) 33*5113495bSYour Name #define TGT_IS_VALID_SNR(x) ((x) >= 0 && (x) < TGT_MAX_SNR) 34*5113495bSYour Name #define TGT_IS_VALID_RSSI(x) ((x) != 0xFF) 35*5113495bSYour Name 36*5113495bSYour Name /** 37*5113495bSYour Name * struct wlan_vdev_ch_check_filter - vdev chan check filter object 38*5113495bSYour Name * @flag: matches or not 39*5113495bSYour Name * @vdev: vdev to be checked against all the active vdevs 40*5113495bSYour Name */ 41*5113495bSYour Name struct wlan_vdev_ch_check_filter { 42*5113495bSYour Name uint8_t flag; 43*5113495bSYour Name struct wlan_objmgr_vdev *vdev; 44*5113495bSYour Name }; 45*5113495bSYour Name 46*5113495bSYour Name /** 47*5113495bSYour Name * struct wlan_op_mode_peer_count - vdev connected peer count 48*5113495bSYour Name * @opmode: QDF mode 49*5113495bSYour Name * @peer_count: peer count 50*5113495bSYour Name **/ 51*5113495bSYour Name struct wlan_op_mode_peer_count { 52*5113495bSYour Name enum QDF_OPMODE opmode; 53*5113495bSYour Name uint16_t peer_count; 54*5113495bSYour Name }; 55*5113495bSYour Name 56*5113495bSYour Name /** 57*5113495bSYour Name * wlan_construct_shortssid() - construct the short ssid with the help of 58*5113495bSYour Name * shortssid table 59*5113495bSYour Name * @ssid: pointer to ssid 60*5113495bSYour Name * @ssid_len: ssid length 61*5113495bSYour Name * 62*5113495bSYour Name * return: short ssid length 63*5113495bSYour Name */ 64*5113495bSYour Name uint32_t wlan_construct_shortssid(uint8_t *ssid, uint8_t ssid_len); 65*5113495bSYour Name 66*5113495bSYour Name /** 67*5113495bSYour Name * wlan_chan_to_freq() - converts channel to frequency 68*5113495bSYour Name * @chan: channel number 69*5113495bSYour Name * 70*5113495bSYour Name * @return frequency of the channel 71*5113495bSYour Name */ 72*5113495bSYour Name uint32_t wlan_chan_to_freq(uint8_t chan); 73*5113495bSYour Name 74*5113495bSYour Name /** 75*5113495bSYour Name * wlan_get_320_center_freq() - find center frequencies for 320Mhz channel 76*5113495bSYour Name * @freq: Primary frequency 77*5113495bSYour Name * @center_freq1: possible 1st center frequency 78*5113495bSYour Name * @center_freq2: possible 2nd center frequency 79*5113495bSYour Name * 80*5113495bSYour Name * return: void 81*5113495bSYour Name **/ 82*5113495bSYour Name void 83*5113495bSYour Name wlan_get_320_center_freq(qdf_freq_t freq, 84*5113495bSYour Name qdf_freq_t *center_freq1, 85*5113495bSYour Name qdf_freq_t *center_freq2); 86*5113495bSYour Name 87*5113495bSYour Name /** 88*5113495bSYour Name * wlan_freq_to_chan() - converts frequency to channel 89*5113495bSYour Name * @freq: frequency 90*5113495bSYour Name * 91*5113495bSYour Name * Return: channel of frequency 92*5113495bSYour Name */ 93*5113495bSYour Name uint8_t wlan_freq_to_chan(uint32_t freq); 94*5113495bSYour Name 95*5113495bSYour Name /** 96*5113495bSYour Name * wlan_is_ie_valid() - Determine if an IE sequence is valid 97*5113495bSYour Name * @ie: Pointer to the IE buffer 98*5113495bSYour Name * @ie_len: Length of the IE buffer @ie 99*5113495bSYour Name * 100*5113495bSYour Name * This function validates that the IE sequence is valid by verifying 101*5113495bSYour Name * that the sum of the lengths of the embedded elements match the 102*5113495bSYour Name * length of the sequence. 103*5113495bSYour Name * 104*5113495bSYour Name * Note well that a 0-length IE sequence is considered valid. 105*5113495bSYour Name * 106*5113495bSYour Name * Return: true if the IE sequence is valid, false if it is invalid 107*5113495bSYour Name */ 108*5113495bSYour Name bool wlan_is_ie_valid(const uint8_t *ie, size_t ie_len); 109*5113495bSYour Name 110*5113495bSYour Name /** 111*5113495bSYour Name * wlan_get_ie_ptr_from_eid() - Find out ie from eid 112*5113495bSYour Name * @eid: element id 113*5113495bSYour Name * @ie: source ie address 114*5113495bSYour Name * @ie_len: source ie length 115*5113495bSYour Name * 116*5113495bSYour Name * Return: vendor ie address - success 117*5113495bSYour Name * NULL - failure 118*5113495bSYour Name */ 119*5113495bSYour Name const uint8_t *wlan_get_ie_ptr_from_eid(uint8_t eid, 120*5113495bSYour Name const uint8_t *ie, 121*5113495bSYour Name int ie_len); 122*5113495bSYour Name 123*5113495bSYour Name /** 124*5113495bSYour Name * wlan_get_vendor_ie_ptr_from_oui() - Find out vendor ie 125*5113495bSYour Name * @oui: oui buffer 126*5113495bSYour Name * @oui_size: oui size 127*5113495bSYour Name * @ie: source ie address 128*5113495bSYour Name * @ie_len: source ie length 129*5113495bSYour Name * 130*5113495bSYour Name * This function find out vendor ie by pass source ie and vendor oui. 131*5113495bSYour Name * 132*5113495bSYour Name * Return: vendor ie address - success 133*5113495bSYour Name * NULL - failure 134*5113495bSYour Name */ 135*5113495bSYour Name const uint8_t *wlan_get_vendor_ie_ptr_from_oui(const uint8_t *oui, 136*5113495bSYour Name uint8_t oui_size, 137*5113495bSYour Name const uint8_t *ie, 138*5113495bSYour Name uint16_t ie_len); 139*5113495bSYour Name 140*5113495bSYour Name /** 141*5113495bSYour Name * wlan_get_ext_ie_ptr_from_ext_id() - Find out ext ie 142*5113495bSYour Name * @oui: oui buffer 143*5113495bSYour Name * @oui_size: oui size 144*5113495bSYour Name * @ie: source ie address 145*5113495bSYour Name * @ie_len: source ie length 146*5113495bSYour Name * 147*5113495bSYour Name * This function find out ext ie from ext id (passed oui) 148*5113495bSYour Name * 149*5113495bSYour Name * Return: vendor ie address - success 150*5113495bSYour Name * NULL - failure 151*5113495bSYour Name */ 152*5113495bSYour Name const uint8_t *wlan_get_ext_ie_ptr_from_ext_id(const uint8_t *oui, 153*5113495bSYour Name uint8_t oui_size, 154*5113495bSYour Name const uint8_t *ie, 155*5113495bSYour Name uint16_t ie_len); 156*5113495bSYour Name 157*5113495bSYour Name /** 158*5113495bSYour Name * wlan_iecap_set() - Set the capability in the IE 159*5113495bSYour Name * @iecap: pointer to capability IE 160*5113495bSYour Name * @bit_pos: bit position of capability from start of capability field 161*5113495bSYour Name * @tot_bits: total bits of capability 162*5113495bSYour Name * @value: value to be set 163*5113495bSYour Name * 164*5113495bSYour Name * This function sets the value in capability IE at the bit position 165*5113495bSYour Name * specified for specified number of bits in byte order. 166*5113495bSYour Name * 167*5113495bSYour Name * Return: void 168*5113495bSYour Name */ 169*5113495bSYour Name void wlan_iecap_set(uint8_t *iecap, 170*5113495bSYour Name uint8_t bit_pos, 171*5113495bSYour Name uint8_t tot_bits, 172*5113495bSYour Name uint32_t value); 173*5113495bSYour Name 174*5113495bSYour Name /** 175*5113495bSYour Name * wlan_iecap_get() - Get the capability in the IE 176*5113495bSYour Name * @iecap: pointer to capability IE 177*5113495bSYour Name * @bit_pos: bit position of capability from start of capability field 178*5113495bSYour Name * @tot_bits: total bits of capability 179*5113495bSYour Name * 180*5113495bSYour Name * This function gets the value at bit position for specified bits 181*5113495bSYour Name * from start of capability field. 182*5113495bSYour Name * 183*5113495bSYour Name * Return: capability value 184*5113495bSYour Name */ 185*5113495bSYour Name uint32_t wlan_iecap_get(uint8_t *iecap, 186*5113495bSYour Name uint8_t bit_pos, 187*5113495bSYour Name uint32_t tot_bits); 188*5113495bSYour Name 189*5113495bSYour Name /** 190*5113495bSYour Name * wlan_get_elem_fragseq_requirements() - Get requirements related to generation 191*5113495bSYour Name * of element fragment sequence. 192*5113495bSYour Name * 193*5113495bSYour Name * @elemid: Element ID 194*5113495bSYour Name * @payloadlen: Length of element payload to be fragmented. Irrespective of 195*5113495bSYour Name * whether inline fragmentation in wlan_create_elem_fragseq() is to be used or 196*5113495bSYour Name * not, this length should not include the length of the element ID and element 197*5113495bSYour Name * length, and if the element ID is WLAN_ELEMID_EXTN_ELEM, it should not include 198*5113495bSYour Name * the length of the element ID extension. 199*5113495bSYour Name * @is_frag_required: Pointer to location where the function should update 200*5113495bSYour Name * whether fragmentation is required or not for the given element ID and payload 201*5113495bSYour Name * length. The caller should ignore this if the function returns failure. 202*5113495bSYour Name * @required_fragbuff_size: Pointer to location where the function should update 203*5113495bSYour Name * the required minimum size of the buffer where the fragment sequence created 204*5113495bSYour Name * would be written, starting from the beginning of the buffer (irrespective of 205*5113495bSYour Name * whether inline fragmentation in wlan_create_elem_fragseq() is to be used or 206*5113495bSYour Name * not). This is the total size of the element fragment sequence, inclusive of 207*5113495bSYour Name * the header and payload of the leading element and the headers and payloads of 208*5113495bSYour Name * all subsequent fragments applicable to that element. If the element ID is 209*5113495bSYour Name * WLAN_ELEMID_EXTN_ELEM, this also includes the length of the element ID 210*5113495bSYour Name * extension. The caller should ignore this if the function returns a value of 211*5113495bSYour Name * false for is_frag_required, or if the function returns failure. 212*5113495bSYour Name * 213*5113495bSYour Name * Get information on requirements related to generation of element fragment 214*5113495bSYour Name * sequence. Currently this includes an indication of whether fragmentation is 215*5113495bSYour Name * required or not for the given element ID and payload length, and if 216*5113495bSYour Name * fragmentation is applicable, the minimum required size of the buffer where 217*5113495bSYour Name * the fragment sequence created would be written (irrespective of whether 218*5113495bSYour Name * inline fragmentation in wlan_create_elem_fragseq() is to be used or not). 219*5113495bSYour Name * 220*5113495bSYour Name * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving 221*5113495bSYour Name * the reason for error in the case of failure 222*5113495bSYour Name */ 223*5113495bSYour Name QDF_STATUS 224*5113495bSYour Name wlan_get_elem_fragseq_requirements(uint8_t elemid, 225*5113495bSYour Name qdf_size_t payloadlen, 226*5113495bSYour Name bool *is_frag_required, 227*5113495bSYour Name qdf_size_t *required_fragbuff_size); 228*5113495bSYour Name 229*5113495bSYour Name /** 230*5113495bSYour Name * wlan_create_elem_fragseq() - Create sequence of element fragments 231*5113495bSYour Name * 232*5113495bSYour Name * @inline_frag: Whether to use inline fragmentation, wherein the fragmentation 233*5113495bSYour Name * is carried out inline within the source buffer and no memmoves/memcopy would 234*5113495bSYour Name * be required for the lead element. 235*5113495bSYour Name * @elemid: Element ID 236*5113495bSYour Name * @elemidext: Element ID extension. This is applicable only if elemid is 237*5113495bSYour Name * WLAN_ELEMID_EXTN_ELEM, otherwise it is ignored. 238*5113495bSYour Name * @payloadbuff: Buffer containing the element payload to be fragmented. If 239*5113495bSYour Name * inline fragmentation is selected, the corresponding element fragment sequence 240*5113495bSYour Name * will be generated inline into this buffer, and prior to the payload the 241*5113495bSYour Name * buffer should have two bytes reserved in the beginning for the element ID and 242*5113495bSYour Name * element length fields to be written, and a third byte reserved after them for 243*5113495bSYour Name * the element ID extension to be written (if the element ID is 244*5113495bSYour Name * WLAN_ELEMID_EXTN_ELEM). 245*5113495bSYour Name * @payloadbuff_maxsize: Maximum size of payloadbuff 246*5113495bSYour Name * @payloadlen: Length of element payload to be fragmented. Irrespective of 247*5113495bSYour Name * whether inline fragmentation is to be used or not, this should not include 248*5113495bSYour Name * the length of the element ID and element length, and if the element ID is 249*5113495bSYour Name * WLAN_ELEMID_EXTN_ELEM, it should not include the length of the element ID 250*5113495bSYour Name * extension. 251*5113495bSYour Name * @fragbuff: The buffer into which the element fragment sequence should be 252*5113495bSYour Name * generated. This is inapplicable and ignored if inline fragmentation is used. 253*5113495bSYour Name * @fragbuff_maxsize: The maximum size of fragbuff. This is inapplicable and 254*5113495bSYour Name * ignored if inline fragmentation is used. 255*5113495bSYour Name * @fragseqlen: Pointer to location where the length of the fragment sequence 256*5113495bSYour Name * created should be written. This is the total length of the element fragment 257*5113495bSYour Name * sequence, inclusive of the header and payload of the leading element and the 258*5113495bSYour Name * headers and payloads of all subsequent fragments applicable to that element. 259*5113495bSYour Name * If the element ID is WLAN_ELEMID_EXTN_ELEM, this also includes the length of 260*5113495bSYour Name * the element ID extension. The caller should ignore this if the function 261*5113495bSYour Name * returns failure. 262*5113495bSYour Name * 263*5113495bSYour Name * Create a sequence of element fragments. In case fragmentation is not required 264*5113495bSYour Name * for the given element ID and payload length, the function returns an error. 265*5113495bSYour Name * This function is intended to be used by callers which do not have the ability 266*5113495bSYour Name * (or for maintainability purposes do not desire the complexity) to inject new 267*5113495bSYour Name * fragments on the fly where required, when populating the fields in the 268*5113495bSYour Name * element (which would completely eliminate memory moves/copies). An inline 269*5113495bSYour Name * mode is available to carry out the fragmentation within the source buffer in 270*5113495bSYour Name * order to reduce buffer requirements and to eliminate memory copies/moves for 271*5113495bSYour Name * the lead element. In the inline mode, the source buffer should have bytes 272*5113495bSYour Name * reserved in the beginning for the element ID, element length, and if 273*5113495bSYour Name * applicable, the element ID extension. In the inline mode the buffer content 274*5113495bSYour Name * (if any) after the fragments is moved as well. 275*5113495bSYour Name * 276*5113495bSYour Name * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving 277*5113495bSYour Name * the reason for error in the case of failure 278*5113495bSYour Name */ 279*5113495bSYour Name QDF_STATUS wlan_create_elem_fragseq(bool inline_frag, 280*5113495bSYour Name uint8_t elemid, 281*5113495bSYour Name uint8_t elemidext, 282*5113495bSYour Name uint8_t *payloadbuff, 283*5113495bSYour Name qdf_size_t payloadbuff_maxsize, 284*5113495bSYour Name qdf_size_t payloadlen, 285*5113495bSYour Name uint8_t *fragbuff, 286*5113495bSYour Name qdf_size_t fragbuff_maxsize, 287*5113495bSYour Name qdf_size_t *fragseqlen); 288*5113495bSYour Name 289*5113495bSYour Name /** 290*5113495bSYour Name * wlan_get_subelem_fragseq_requirements() - Get requirements related to 291*5113495bSYour Name * generation of subelement fragment sequence. 292*5113495bSYour Name * 293*5113495bSYour Name * @subelemid: Subelement ID 294*5113495bSYour Name * @payloadlen: Length of subelement payload to be fragmented. Irrespective of 295*5113495bSYour Name * whether inline fragmentation in wlan_create_subelem_fragseq() is to be used 296*5113495bSYour Name * or not, this length should not include the length of the subelement ID and 297*5113495bSYour Name * subelement length. 298*5113495bSYour Name * @is_frag_required: Pointer to location where the function should update 299*5113495bSYour Name * whether fragmentation is required or not for the given payload length. The 300*5113495bSYour Name * caller should ignore this if the function returns failure. 301*5113495bSYour Name * @required_fragbuff_size: Pointer to location where the function should update 302*5113495bSYour Name * the required minimum size of the buffer where the fragment sequence created 303*5113495bSYour Name * would be written, starting from the beginning of the buffer (irrespective of 304*5113495bSYour Name * whether inline fragmentation in wlan_create_subelem_fragseq() is to be used 305*5113495bSYour Name * or not). This is the total size of the subelement fragment sequence, 306*5113495bSYour Name * inclusive of the header and payload of the leading subelement and the headers 307*5113495bSYour Name * and payloads of all subsequent fragments applicable to that subelement. The 308*5113495bSYour Name * caller should ignore this if the function returns a value of false for 309*5113495bSYour Name * is_frag_required, or if the function returns failure. 310*5113495bSYour Name * 311*5113495bSYour Name * Get information on requirements related to generation of subelement fragment 312*5113495bSYour Name * sequence. Currently this includes an indication of whether fragmentation is 313*5113495bSYour Name * required or not for the given payload length, and if fragmentation is 314*5113495bSYour Name * applicable, the minimum required size of the buffer where the fragment 315*5113495bSYour Name * sequence created would be written (irrespective of whether inline 316*5113495bSYour Name * fragmentation in wlan_create_subelem_fragseq() is to be used or not). Note 317*5113495bSYour Name * that the subelement ID does not currently play a role in determining the 318*5113495bSYour Name * requirements, but is added as an argument in case it is required in the 319*5113495bSYour Name * future. 320*5113495bSYour Name * 321*5113495bSYour Name * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving 322*5113495bSYour Name * the reason for error in the case of failure 323*5113495bSYour Name */ 324*5113495bSYour Name QDF_STATUS 325*5113495bSYour Name wlan_get_subelem_fragseq_requirements(uint8_t subelemid, 326*5113495bSYour Name qdf_size_t payloadlen, 327*5113495bSYour Name bool *is_frag_required, 328*5113495bSYour Name qdf_size_t *required_fragbuff_size); 329*5113495bSYour Name 330*5113495bSYour Name /** 331*5113495bSYour Name * wlan_create_subelem_fragseq() - Create sequence of subelement fragments 332*5113495bSYour Name * 333*5113495bSYour Name * @inline_frag: Whether to use inline fragmentation, wherein the fragmentation 334*5113495bSYour Name * is carried out inline within the source buffer and no memmoves/memcopy would 335*5113495bSYour Name * be required for the lead subelement. 336*5113495bSYour Name * @subelemid: Subelement ID 337*5113495bSYour Name * @subelemfragid: Fragment ID to be used for the subelement (this can 338*5113495bSYour Name * potentially vary across protocol areas) 339*5113495bSYour Name * @payloadbuff: Buffer containing the subelement payload to be fragmented. If 340*5113495bSYour Name * inline fragmentation is selected, the corresponding subelement fragment 341*5113495bSYour Name * sequence will be generated inline into this buffer, and prior to the payload 342*5113495bSYour Name * the buffer should have two bytes reserved in the beginning for the subelement 343*5113495bSYour Name * ID and subelement length fields to be written. 344*5113495bSYour Name * @payloadbuff_maxsize: Maximum size of payloadbuff 345*5113495bSYour Name * @payloadlen: Length of subelement payload to be fragmented. Irrespective of 346*5113495bSYour Name * whether inline fragmentation is to be used or not, this should not include 347*5113495bSYour Name * the length of the subelement ID and subelement length. 348*5113495bSYour Name * @fragbuff: The buffer into which the subelement fragment sequence should be 349*5113495bSYour Name * generated. This is inapplicable and ignored if inline fragmentation is used. 350*5113495bSYour Name * @fragbuff_maxsize: The maximum size of fragbuff. This is inapplicable and 351*5113495bSYour Name * ignored if inline fragmentation is used. 352*5113495bSYour Name * @fragseqlen: Pointer to location where the length of the fragment sequence 353*5113495bSYour Name * created should be written. This is the total length of the subelement 354*5113495bSYour Name * fragment sequence, inclusive of the header and payload of the leading 355*5113495bSYour Name * subelement and the headers and payloads of all subsequent fragments 356*5113495bSYour Name * applicable to that subelement. The caller should ignore this if the function 357*5113495bSYour Name * returns failure. 358*5113495bSYour Name * 359*5113495bSYour Name * Create a sequence of subelement fragments. In case fragmentation is not 360*5113495bSYour Name * required for the given payload length, the function returns an error. This 361*5113495bSYour Name * function is intended to be used by callers which do not have the ability (or 362*5113495bSYour Name * for maintainability purposes do not desire the complexity) to inject new 363*5113495bSYour Name * fragments on the fly where required, when populating the fields in the 364*5113495bSYour Name * subelement (which would completely eliminate memory moves/copies). An inline 365*5113495bSYour Name * mode is available to carry out the fragmentation within the source buffer in 366*5113495bSYour Name * order to reduce buffer requirements and to eliminate memory copies/moves for 367*5113495bSYour Name * the lead subelement. In the inline mode, the source buffer should have bytes 368*5113495bSYour Name * reserved in the beginning for the subelement ID and the subelement length. In 369*5113495bSYour Name * the inline mode the buffer content (if any) after the fragments is moved as 370*5113495bSYour Name * well. 371*5113495bSYour Name * 372*5113495bSYour Name * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving 373*5113495bSYour Name * the reason for error in the case of failure 374*5113495bSYour Name */ 375*5113495bSYour Name QDF_STATUS wlan_create_subelem_fragseq(bool inline_frag, 376*5113495bSYour Name uint8_t subelemid, 377*5113495bSYour Name uint8_t subelemfragid, 378*5113495bSYour Name uint8_t *payloadbuff, 379*5113495bSYour Name qdf_size_t payloadbuff_maxsize, 380*5113495bSYour Name qdf_size_t payloadlen, 381*5113495bSYour Name uint8_t *fragbuff, 382*5113495bSYour Name qdf_size_t fragbuff_maxsize, 383*5113495bSYour Name qdf_size_t *fragseqlen); 384*5113495bSYour Name 385*5113495bSYour Name /** 386*5113495bSYour Name * wlan_get_elem_fragseq_info() - Get information about element fragment 387*5113495bSYour Name * sequence 388*5113495bSYour Name * 389*5113495bSYour Name * @elembuff: Buffer containing a series of elements to be checked for whether a 390*5113495bSYour Name * contiguous subset of these elements (starting with the first element in the 391*5113495bSYour Name * buffer) form an element fragment sequence. The buffer should start with the 392*5113495bSYour Name * Element ID of the first element. The buffer should not contain any material 393*5113495bSYour Name * other than elements. 394*5113495bSYour Name * @elembuff_maxsize: Maximum size of elembuff 395*5113495bSYour Name * @is_fragseq: Pointer to location of a flag indicating whether this is an 396*5113495bSYour Name * element fragment sequence or not. The flag will be set to true if elembuff 397*5113495bSYour Name * contains an element fragment sequence starting with the element present in 398*5113495bSYour Name * the beginning of the buffer, or the flag will be set to false if the buffer 399*5113495bSYour Name * contains a single non-fragmented element in the beginning. Please note 400*5113495bSYour Name * standards related limitation given in function description below. 401*5113495bSYour Name * @fragseq_totallen: Pointer to location of total length of element fragment 402*5113495bSYour Name * sequence. If is_fragseq is true, then this is set to the total length of the 403*5113495bSYour Name * element fragment sequence, inclusive of the header and payload of the leading 404*5113495bSYour Name * element and the headers and payloads of all subsequent fragments applicable 405*5113495bSYour Name * to that element. If is_fragseq is false, the caller should ignore this. 406*5113495bSYour Name * Please note standards related limitation given in function description below. 407*5113495bSYour Name * @fragseq_payloadlen: Pointer to location of length of payload of element 408*5113495bSYour Name * fragment sequence. If is_fragseq is true, then this length is set to the 409*5113495bSYour Name * total size of the element fragment sequence payload, which does not include 410*5113495bSYour Name * the sizes of the headers of the lead element and subsequent fragments, and 411*5113495bSYour Name * which (if the lead element's element ID is WLAN_ELEMID_EXTN_ELEM) does not 412*5113495bSYour Name * include the size of the lead element's element ID extension. If is_fragseq is 413*5113495bSYour Name * false, the caller should ignore this. Please note standards related 414*5113495bSYour Name * limitation given in function description below. 415*5113495bSYour Name * 416*5113495bSYour Name * Get the following information for a first element present in the beginning of 417*5113495bSYour Name * a given buffer, and a series of elements after it in the given buffer: a) 418*5113495bSYour Name * Whether a contiguous subset of these elements starting with the first element 419*5113495bSYour Name * form an element fragment sequence. b) If they form an element fragment 420*5113495bSYour Name * sequence, then the total length of this sequence inclusive of headers and 421*5113495bSYour Name * payloads of all the elements in the sequence. c) If they form an element 422*5113495bSYour Name * fragment sequence, then the total size of the payloads of all the elements in 423*5113495bSYour Name * the sequence (not including the element ID extension of the lead element, if 424*5113495bSYour Name * applicable). While determining this information, the function may return 425*5113495bSYour Name * errors, including for protocol parsing issues. These protocol parsing issues 426*5113495bSYour Name * include one in which the first element has a length lesser than 255, but the 427*5113495bSYour Name * very next element after it is a fragment element (which is not allowed by the 428*5113495bSYour Name * standard). Separately, please note a limitation arising from the standard 429*5113495bSYour Name * wherein if the caller passes a truncated maximum buffer size such that the 430*5113495bSYour Name * buffer ends prematurely just at the end of a potential lead element with 431*5113495bSYour Name * length 255 or just at the end of a non-lead fragment element with length 255, 432*5113495bSYour Name * the function will have to conclude that the last successfully parsed element 433*5113495bSYour Name * is the final one in the non-fragment or fragment sequence, and return results 434*5113495bSYour Name * accordingly. If another fragment actually exists beyond the given buffer, 435*5113495bSYour Name * this function cannot detect the condition since there is no provision in the 436*5113495bSYour Name * standard to indicate a total fragment sequence size in one place in the 437*5113495bSYour Name * beginning or anywhere else. Hence the caller should take care to provide the 438*5113495bSYour Name * complete buffer with the max size set accordingly. 439*5113495bSYour Name * 440*5113495bSYour Name * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving 441*5113495bSYour Name * the reason for error in the case of failure 442*5113495bSYour Name */ 443*5113495bSYour Name QDF_STATUS wlan_get_elem_fragseq_info(uint8_t *elembuff, 444*5113495bSYour Name qdf_size_t elembuff_maxsize, 445*5113495bSYour Name bool *is_fragseq, 446*5113495bSYour Name qdf_size_t *fragseq_totallen, 447*5113495bSYour Name qdf_size_t *fragseq_payloadlen); 448*5113495bSYour Name 449*5113495bSYour Name /** 450*5113495bSYour Name * wlan_defrag_elem_fragseq() - Defragment sequence of element fragments 451*5113495bSYour Name * 452*5113495bSYour Name * @inline_defrag: Whether to use inline defragmentation, wherein the 453*5113495bSYour Name * defragmentation is carried out inline within the source buffer and no 454*5113495bSYour Name * memmoves/memcopy would be required for the lead element. 455*5113495bSYour Name * @fragbuff: Source buffer containing the element fragment sequence starting 456*5113495bSYour Name * with the Element ID of the lead element. The buffer should not contain any 457*5113495bSYour Name * material other than elements. If inline defragmentation is enabled, the 458*5113495bSYour Name * corresponding defragmented payload will be generated inline into this buffer 459*5113495bSYour Name * and the defragmented payload will start after the location of the lead 460*5113495bSYour Name * element's element ID, element length, and (if the lead element's element ID 461*5113495bSYour Name * is WLAN_ELEMID_EXTN_ELEM), the element ID extension. This defragmented 462*5113495bSYour Name * payload will not contain the headers of any of the other fragments in the 463*5113495bSYour Name * fragment sequence. 464*5113495bSYour Name * @fragbuff_maxsize: Maximum size of fragbuff. This should be greater than or 465*5113495bSYour Name * equal to the total size of the element fragment sequence, inclusive of the 466*5113495bSYour Name * header and payload of the leading element and the headers and payloads of all 467*5113495bSYour Name * subsequent fragments applicable to that element. 468*5113495bSYour Name * @defragbuff: The destination buffer into which the defragmented payload 469*5113495bSYour Name * should be copied. This is inapplicable and ignored if inline_defrag is true. 470*5113495bSYour Name * The defragmented payload will be copied to the start of the destination 471*5113495bSYour Name * buffer without including the headers of the lead element and the subsequent 472*5113495bSYour Name * fragment elements, and (if the lead element's element ID is 473*5113495bSYour Name * WLAN_ELEMID_EXTN_ELEM), without including the element ID extension. 474*5113495bSYour Name * @defragbuff_maxsize: Maximum size of defragbuff. This is inapplicable and 475*5113495bSYour Name * ignored if inline_defrag is true. The size should be large enough to contain 476*5113495bSYour Name * the entire defragmented payload, otherwise an error will be returned. 477*5113495bSYour Name * @defragpayload_len: Pointer to the location where the length of the 478*5113495bSYour Name * defragmented payload should be updated. Irrespective of whether inline_defrag 479*5113495bSYour Name * is true or false, this will not include the sizes of the headers of the lead 480*5113495bSYour Name * element and subsequent fragments, and (if the lead element's element ID is 481*5113495bSYour Name * WLAN_ELEMID_EXTN_ELEM), it will not include the size of the lead element's 482*5113495bSYour Name * element ID extension. Please note standards related limitation given in 483*5113495bSYour Name * function description below. 484*5113495bSYour Name * 485*5113495bSYour Name * Defragment a sequence of element fragments. If the source buffer does not 486*5113495bSYour Name * contain an element fragment sequence (in the beginning), an error is 487*5113495bSYour Name * returned. An inline mode is available to carry out the defragmentation within 488*5113495bSYour Name * the source buffer in order to reduce buffer requirements and to eliminate 489*5113495bSYour Name * memory copies/moves for the lead element. In the inline mode, the buffer 490*5113495bSYour Name * content (if any) after the fragments is moved as well. The contents of the 491*5113495bSYour Name * defragmented payload are intended for end consumption by control path 492*5113495bSYour Name * protocol processing code within the driver in a manner uniform with other 493*5113495bSYour Name * protocol data in byte buffers, and not for onward forwarding to other 494*5113495bSYour Name * subsystems or for intrusive specialized processing different from other 495*5113495bSYour Name * protocol data. Hence zero copy methods such as network buffer fragment 496*5113495bSYour Name * processing, etc. are not used in this use case. Additionally, this API is 497*5113495bSYour Name * intended for use cases where the nature of the payload is complex and it is 498*5113495bSYour Name * infeasible for the caller to skip the (un-defragmented) fragment boundaries 499*5113495bSYour Name * on its own in a scalable and maintainable manner. Separately, please note a 500*5113495bSYour Name * limitation arising from the standard wherein if the caller passes a truncated 501*5113495bSYour Name * maximum buffer size such that the buffer ends prematurely just at the end of 502*5113495bSYour Name * a fragment element with length 255, the function will have to conclude that 503*5113495bSYour Name * the last successfully parsed fragment element is the final one in the 504*5113495bSYour Name * fragment sequence, and return results accordingly. If another fragment 505*5113495bSYour Name * actually exists beyond the given buffer, this function cannot detect the 506*5113495bSYour Name * condition since there is no provision in the standard to indicate a total 507*5113495bSYour Name * fragment sequence size in one place in the beginning or anywhere else. Hence 508*5113495bSYour Name * the caller should take care to provide the complete buffer with the max size 509*5113495bSYour Name * set accordingly. 510*5113495bSYour Name * 511*5113495bSYour Name * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving 512*5113495bSYour Name * the reason for error in the case of failure 513*5113495bSYour Name */ 514*5113495bSYour Name QDF_STATUS wlan_defrag_elem_fragseq(bool inline_defrag, 515*5113495bSYour Name uint8_t *fragbuff, 516*5113495bSYour Name qdf_size_t fragbuff_maxsize, 517*5113495bSYour Name uint8_t *defragbuff, 518*5113495bSYour Name qdf_size_t defragbuff_maxsize, 519*5113495bSYour Name qdf_size_t *defragpayload_len); 520*5113495bSYour Name 521*5113495bSYour Name /** 522*5113495bSYour Name * wlan_get_subelem_fragseq_info() - Get information about subelement fragment 523*5113495bSYour Name * sequence 524*5113495bSYour Name * 525*5113495bSYour Name * @subelemfragid: Fragment ID applicable for the subelement (this can 526*5113495bSYour Name * potentially vary across protocol areas) 527*5113495bSYour Name * @subelembuff: Buffer containing a series of subelements to be checked for 528*5113495bSYour Name * whether a contiguous subset of these subelements (starting with the first 529*5113495bSYour Name * subelement in the buffer) form a subelement fragment sequence. The containing 530*5113495bSYour Name * element is required to have already been defragmented (if applicable). The 531*5113495bSYour Name * buffer should start with the subelement ID of the first subelement. The 532*5113495bSYour Name * buffer should not contain any material apart from subelements. 533*5113495bSYour Name * @subelembuff_maxsize: Maximum size of subelembuff 534*5113495bSYour Name * @is_fragseq: Pointer to location of a flag indicating whether this is a 535*5113495bSYour Name * subelement fragment sequence or not. The flag will be set to true if the 536*5113495bSYour Name * buffer contains a subelement fragment sequence starting with the subelement 537*5113495bSYour Name * present in the beginning of the buffer, or the flag will be set to false if 538*5113495bSYour Name * the buffer contains a single non-fragmented subelement in the beginning. 539*5113495bSYour Name * Please note standards related limitation given in function description below. 540*5113495bSYour Name * @fragseq_totallen: Pointer to location of total length of subelement fragment 541*5113495bSYour Name * sequence. If is_fragseq is true, then this is set to the total length of the 542*5113495bSYour Name * subelement fragment sequence, inclusive of the header and payload of the 543*5113495bSYour Name * leading subelement and the headers and payloads of all subsequent fragments 544*5113495bSYour Name * applicable to that subelement. If is_fragseq is false, the caller should 545*5113495bSYour Name * ignore this. Please note standards related limitation given in function 546*5113495bSYour Name * description below. 547*5113495bSYour Name * @fragseq_payloadlen: Pointer to location of length of payload of subelement 548*5113495bSYour Name * fragment sequence. If is_fragseq is true, then this length is set to the 549*5113495bSYour Name * total size of the subelement fragment sequence payload, which does not 550*5113495bSYour Name * include the sizes of the headers of the lead subelement and subsequent 551*5113495bSYour Name * fragments. If is_fragseq is false, the caller should ignore this. Please note 552*5113495bSYour Name * standards related limitation given in function description below. 553*5113495bSYour Name * 554*5113495bSYour Name * Get the following information for a first subelement present in the beginning 555*5113495bSYour Name * of a given buffer, and a series of subelements after it in the given buffer: 556*5113495bSYour Name * a) Whether a contiguous subset of these subelements starting with the first 557*5113495bSYour Name * subelement form a subelement fragment sequence. b) If they form a subelement 558*5113495bSYour Name * fragment sequence, then the total length of this sequence inclusive of 559*5113495bSYour Name * headers and payloads of all the subelements in the sequence. c) If they form 560*5113495bSYour Name * a subelement fragment sequence, then the total size of the payloads of all 561*5113495bSYour Name * the subelements in the sequence. While determining this information, the 562*5113495bSYour Name * function may return errors, including for protocol parsing issues. These 563*5113495bSYour Name * protocol parsing issues include one in which the first subelement has a 564*5113495bSYour Name * length lesser than 255, but the very next subelement after it is a fragment 565*5113495bSYour Name * subelement (which is not allowed by the standard so far). Separately, please 566*5113495bSYour Name * note a limitation arising from the standard wherein if the caller passes a 567*5113495bSYour Name * truncated maximum buffer size such that the buffer ends prematurely just at 568*5113495bSYour Name * the end of a potential lead subelement with length 255 or just at the end of 569*5113495bSYour Name * a non-lead fragment subelement with length 255, the function will have to 570*5113495bSYour Name * conclude that the last successfully parsed subelement is the final one in the 571*5113495bSYour Name * non-fragment or fragment sequence, and return results accordingly. If another 572*5113495bSYour Name * fragment actually exists beyond the given buffer, this function cannot detect 573*5113495bSYour Name * the condition since there is no provision in the standard to indicate a total 574*5113495bSYour Name * fragment sequence size in one place in the beginning or anywhere else. Hence 575*5113495bSYour Name * the caller should take care to provide the complete buffer with the max size 576*5113495bSYour Name * set accordingly. 577*5113495bSYour Name * 578*5113495bSYour Name * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving 579*5113495bSYour Name * the reason for error in the case of failure 580*5113495bSYour Name */ 581*5113495bSYour Name QDF_STATUS wlan_get_subelem_fragseq_info(uint8_t subelemfragid, 582*5113495bSYour Name uint8_t *subelembuff, 583*5113495bSYour Name qdf_size_t subelembuff_maxsize, 584*5113495bSYour Name bool *is_fragseq, 585*5113495bSYour Name qdf_size_t *fragseq_totallen, 586*5113495bSYour Name qdf_size_t *fragseq_payloadlen); 587*5113495bSYour Name 588*5113495bSYour Name /** 589*5113495bSYour Name * wlan_defrag_subelem_fragseq() - Defragment sequence of subelement fragments 590*5113495bSYour Name * 591*5113495bSYour Name * @inline_defrag: Whether to use inline defragmentation, wherein the 592*5113495bSYour Name * defragmentation is carried out inline within the source buffer and no 593*5113495bSYour Name * memmoves/memcopy would be required for the lead subelement. 594*5113495bSYour Name * @subelemfragid: Fragment ID applicable for the subelement (this can 595*5113495bSYour Name * potentially vary across protocol areas) 596*5113495bSYour Name * @fragbuff: Source buffer containing the subelement fragment sequence starting 597*5113495bSYour Name * with the subelement ID of the lead subelement. The containing element is 598*5113495bSYour Name * required to have already been defragmented (if applicable). If inline 599*5113495bSYour Name * defragmentation is enabled, the corresponding defragmented payload will be 600*5113495bSYour Name * generated inline into this buffer and the defragmented payload will start 601*5113495bSYour Name * after the location of the lead subelement's subelement ID and subelement 602*5113495bSYour Name * length. This defragmented payload will not contain the headers of any of the 603*5113495bSYour Name * other fragments in the fragment sequence. 604*5113495bSYour Name * @fragbuff_maxsize: Maximum size of fragbuff. This should be greater than or 605*5113495bSYour Name * equal to the total size of the subelement fragment sequence, inclusive of the 606*5113495bSYour Name * header and payload of the leading subelement and the headers and payloads of 607*5113495bSYour Name * all subsequent fragments applicable to that subelement. 608*5113495bSYour Name * @defragbuff: The destination buffer into which the defragmented payload 609*5113495bSYour Name * should be copied. This is inapplicable and ignored if inline_defrag is true. 610*5113495bSYour Name * The defragmented payload will be copied to the start of the destination 611*5113495bSYour Name * buffer without including the headers of the lead subelement and the 612*5113495bSYour Name * subsequent fragment subelements. 613*5113495bSYour Name * @defragbuff_maxsize: Maximum size of defragbuff. This is inapplicable and 614*5113495bSYour Name * ignored if inline_defrag is true. The size should be large enough to contain 615*5113495bSYour Name * the entire defragmented payload, otherwise an error will be returned. 616*5113495bSYour Name * @defragpayload_len: Pointer to the location where the length of the 617*5113495bSYour Name * defragmented payload should be updated. Irrespective of whether inline_defrag 618*5113495bSYour Name * is true or false, this will not include the sizes of the headers of the lead 619*5113495bSYour Name * subelement and subsequent fragments. Please note standards related limitation 620*5113495bSYour Name * given in function description below. 621*5113495bSYour Name * 622*5113495bSYour Name * Defragment a sequence of subelement fragments. If the source buffer does not 623*5113495bSYour Name * contain a subelement fragment sequence (in the beginning), the function 624*5113495bSYour Name * returns an error. The containing element is required to have already been 625*5113495bSYour Name * defragmented. An inline mode is available to carry out the defragmentation 626*5113495bSYour Name * within the source buffer in order to reduce buffer requirements and to 627*5113495bSYour Name * eliminate memory copies/moves for the lead subelement. In the inline mode, 628*5113495bSYour Name * the buffer content (if any) after the fragments is moved as well. The 629*5113495bSYour Name * contents of the defragmented payload are intended for end consumption by 630*5113495bSYour Name * control path protocol processing code within the driver in a manner uniform 631*5113495bSYour Name * with other protocol data in byte buffers, and not for onward forwarding to 632*5113495bSYour Name * other subsystems or for intrusive specialized processing different from other 633*5113495bSYour Name * protocol data. Hence zero copy methods such as network buffer fragment 634*5113495bSYour Name * processing, etc. are not used in this use case. Additionally, this API is 635*5113495bSYour Name * intended for use cases where the nature of the payload is complex and it is 636*5113495bSYour Name * infeasible for the caller to skip the (un-defragmented) fragment boundaries 637*5113495bSYour Name * on its own in a scalable and maintainable manner. Separately, please note a 638*5113495bSYour Name * limitation arising from the standard wherein if the caller passes a truncated 639*5113495bSYour Name * maximum buffer size such that the buffer ends prematurely just at the end of 640*5113495bSYour Name * a fragment subelement with length 255, the function will have to conclude 641*5113495bSYour Name * that the last successfully parsed fragment subelement is the final one in the 642*5113495bSYour Name * fragment sequence, and return results accordingly. If another fragment 643*5113495bSYour Name * actually exists beyond the given buffer, this function cannot detect the 644*5113495bSYour Name * condition since there is no provision in the standard to indicate a total 645*5113495bSYour Name * fragment sequence size in one place in the beginning or anywhere else. Hence 646*5113495bSYour Name * the caller should take care to provide the complete buffer with the max size 647*5113495bSYour Name * set accordingly. 648*5113495bSYour Name * 649*5113495bSYour Name * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving 650*5113495bSYour Name * the reason for error in the case of failure 651*5113495bSYour Name */ 652*5113495bSYour Name QDF_STATUS wlan_defrag_subelem_fragseq(bool inline_defrag, 653*5113495bSYour Name uint8_t subelemfragid, 654*5113495bSYour Name uint8_t *fragbuff, 655*5113495bSYour Name qdf_size_t fragbuff_maxsize, 656*5113495bSYour Name uint8_t *defragbuff, 657*5113495bSYour Name qdf_size_t defragbuff_maxsize, 658*5113495bSYour Name qdf_size_t *defragpayload_len); 659*5113495bSYour Name 660*5113495bSYour Name /** 661*5113495bSYour Name * wlan_is_emulation_platform() - check if platform is emulation based 662*5113495bSYour Name * @phy_version: psoc nif phy_version 663*5113495bSYour Name * 664*5113495bSYour Name * Return: boolean value based on platform type 665*5113495bSYour Name */ 666*5113495bSYour Name bool wlan_is_emulation_platform(uint32_t phy_version); 667*5113495bSYour Name 668*5113495bSYour Name /** 669*5113495bSYour Name * wlan_get_pdev_id_from_vdev_id() - Helper func to derive pdev id from vdev_id 670*5113495bSYour Name * @psoc: psoc object 671*5113495bSYour Name * @vdev_id: vdev identifier 672*5113495bSYour Name * @dbg_id: object manager debug id 673*5113495bSYour Name * 674*5113495bSYour Name * This function is used to derive the pdev id from vdev id for a psoc 675*5113495bSYour Name * 676*5113495bSYour Name * Return : pdev_id - +ve integer for success and WLAN_INVALID_PDEV_ID 677*5113495bSYour Name * for failure 678*5113495bSYour Name */ 679*5113495bSYour Name uint32_t wlan_get_pdev_id_from_vdev_id(struct wlan_objmgr_psoc *psoc, 680*5113495bSYour Name uint8_t vdev_id, 681*5113495bSYour Name wlan_objmgr_ref_dbgid dbg_id); 682*5113495bSYour Name 683*5113495bSYour Name /** 684*5113495bSYour Name * wlan_util_is_vdev_active() - Check for vdev active 685*5113495bSYour Name * @pdev: pdev pointer 686*5113495bSYour Name * @dbg_id: debug id for ref counting 687*5113495bSYour Name * 688*5113495bSYour Name * Return: QDF_STATUS_SUCCESS in case of vdev active 689*5113495bSYour Name * QDF_STATUS_E_INVAL, if dev is not active 690*5113495bSYour Name */ 691*5113495bSYour Name QDF_STATUS wlan_util_is_vdev_active(struct wlan_objmgr_pdev *pdev, 692*5113495bSYour Name wlan_objmgr_ref_dbgid dbg_id); 693*5113495bSYour Name 694*5113495bSYour Name /** 695*5113495bSYour Name * wlan_vdev_is_up() - Check for vdev is in UP state 696*5113495bSYour Name * @vdev: vdev pointer 697*5113495bSYour Name * 698*5113495bSYour Name * Return: QDF_STATUS_SUCCESS, if vdev is in up, otherwise QDF_STATUS_E_FAILURE 699*5113495bSYour Name */ 700*5113495bSYour Name QDF_STATUS wlan_vdev_is_up(struct wlan_objmgr_vdev *vdev); 701*5113495bSYour Name 702*5113495bSYour Name /** 703*5113495bSYour Name * wlan_util_pdev_vdevs_deschan_match() - function to check des channel matches 704*5113495bSYour Name * with other vdevs in pdev 705*5113495bSYour Name * @pdev: pdev object 706*5113495bSYour Name * @vdev: vdev object 707*5113495bSYour Name * @dbg_id: object manager ref id 708*5113495bSYour Name * 709*5113495bSYour Name * This function checks the vdev desired channel with other vdev channels 710*5113495bSYour Name * 711*5113495bSYour Name * Return: QDF_STATUS_SUCCESS, if it matches, otherwise QDF_STATUS_E_FAILURE 712*5113495bSYour Name */ 713*5113495bSYour Name QDF_STATUS wlan_util_pdev_vdevs_deschan_match(struct wlan_objmgr_pdev *pdev, 714*5113495bSYour Name struct wlan_objmgr_vdev *vdev, 715*5113495bSYour Name wlan_objmgr_ref_dbgid dbg_id); 716*5113495bSYour Name 717*5113495bSYour Name /** 718*5113495bSYour Name * wlan_util_change_map_index() - function to set/reset given index bit 719*5113495bSYour Name * @map: bitmpap 720*5113495bSYour Name * @id: bit index 721*5113495bSYour Name * @set: 1 for set, 0 of reset 722*5113495bSYour Name * 723*5113495bSYour Name * This function set/reset given index bit 724*5113495bSYour Name * 725*5113495bSYour Name * Return: void 726*5113495bSYour Name */ 727*5113495bSYour Name void wlan_util_change_map_index(unsigned long *map, uint8_t id, uint8_t set); 728*5113495bSYour Name 729*5113495bSYour Name /** 730*5113495bSYour Name * wlan_util_map_index_is_set() - function to check whether given index bit is 731*5113495bSYour Name * set 732*5113495bSYour Name * @map: bitmpap 733*5113495bSYour Name * @id: bit index 734*5113495bSYour Name * 735*5113495bSYour Name * This function checks the given index bit is set 736*5113495bSYour Name * 737*5113495bSYour Name * Return: true, if bit is set, otherwise false 738*5113495bSYour Name */ 739*5113495bSYour Name bool wlan_util_map_index_is_set(unsigned long *map, uint8_t id); 740*5113495bSYour Name 741*5113495bSYour Name /** 742*5113495bSYour Name * wlan_util_map_is_any_index_set() - Check if any bit is set in given bitmap 743*5113495bSYour Name * @map: bitmap 744*5113495bSYour Name * @nbytes: number of bytes in bitmap 745*5113495bSYour Name * 746*5113495bSYour Name * Return: true, if any of the bit is set, otherwise false 747*5113495bSYour Name */ 748*5113495bSYour Name bool wlan_util_map_is_any_index_set(unsigned long *map, unsigned long nbytes); 749*5113495bSYour Name 750*5113495bSYour Name /** 751*5113495bSYour Name * wlan_pdev_chan_change_pending_vdevs() - function to test/set channel change 752*5113495bSYour Name * pending flag 753*5113495bSYour Name * @pdev: pdev object 754*5113495bSYour Name * @vdev_id_map: bitmap to derive channel change vdevs 755*5113495bSYour Name * @dbg_id: object manager ref id 756*5113495bSYour Name * 757*5113495bSYour Name * This function test/set channel change pending flag 758*5113495bSYour Name * 759*5113495bSYour Name * Return: QDF_STATUS_SUCCESS, if it iterates through all vdevs, 760*5113495bSYour Name * otherwise QDF_STATUS_E_FAILURE 761*5113495bSYour Name */ 762*5113495bSYour Name QDF_STATUS wlan_pdev_chan_change_pending_vdevs(struct wlan_objmgr_pdev *pdev, 763*5113495bSYour Name unsigned long *vdev_id_map, 764*5113495bSYour Name wlan_objmgr_ref_dbgid dbg_id); 765*5113495bSYour Name 766*5113495bSYour Name /** 767*5113495bSYour Name * wlan_pdev_chan_change_pending_vdevs_down() - function to test/set down 768*5113495bSYour Name * change pending flag 769*5113495bSYour Name * @pdev: pdev object 770*5113495bSYour Name * @vdev_id_map: bitmap to derive channel change vdevs 771*5113495bSYour Name * @dbg_id: object manager ref id 772*5113495bSYour Name * 773*5113495bSYour Name * This function test/set channel change pending flag 774*5113495bSYour Name * 775*5113495bSYour Name * Return: QDF_STATUS_SUCCESS, if it iterates through all vdevs, 776*5113495bSYour Name * otherwise QDF_STATUS_E_FAILURE 777*5113495bSYour Name */ 778*5113495bSYour Name QDF_STATUS wlan_pdev_chan_change_pending_vdevs_down( 779*5113495bSYour Name struct wlan_objmgr_pdev *pdev, 780*5113495bSYour Name unsigned long *vdev_id_map, 781*5113495bSYour Name wlan_objmgr_ref_dbgid dbg_id); 782*5113495bSYour Name 783*5113495bSYour Name /** 784*5113495bSYour Name * wlan_pdev_chan_change_pending_ap_vdevs_down() - function to test/set channel 785*5113495bSYour Name * change pending flag for AP VDEVs 786*5113495bSYour Name * @pdev: pdev object 787*5113495bSYour Name * @vdev_id_map: bitmap to derive channel change AP vdevs 788*5113495bSYour Name * @dbg_id: object manager ref id 789*5113495bSYour Name * 790*5113495bSYour Name * This function test/set channel change pending flag for AP vdevs 791*5113495bSYour Name * 792*5113495bSYour Name * Return: QDF_STATUS_SUCCESS, if it iterates through all vdevs, 793*5113495bSYour Name * otherwise QDF_STATUS_E_FAILURE 794*5113495bSYour Name */ 795*5113495bSYour Name QDF_STATUS wlan_pdev_chan_change_pending_ap_vdevs_down( 796*5113495bSYour Name struct wlan_objmgr_pdev *pdev, 797*5113495bSYour Name unsigned long *vdev_id_map, 798*5113495bSYour Name wlan_objmgr_ref_dbgid dbg_id); 799*5113495bSYour Name 800*5113495bSYour Name /** 801*5113495bSYour Name * wlan_chan_eq() - function to check whether both channels are same 802*5113495bSYour Name * @chan1: channel1 object 803*5113495bSYour Name * @chan2: channel2 object 804*5113495bSYour Name * 805*5113495bSYour Name * This function checks the chan1 and chan2 are same 806*5113495bSYour Name * 807*5113495bSYour Name * Return: QDF_STATUS_SUCCESS, if it matches, otherwise QDF_STATUS_E_FAILURE 808*5113495bSYour Name */ 809*5113495bSYour Name QDF_STATUS wlan_chan_eq(struct wlan_channel *chan1, struct wlan_channel *chan2); 810*5113495bSYour Name 811*5113495bSYour Name /** 812*5113495bSYour Name * wlan_chan_copy() - function to copy channel 813*5113495bSYour Name * @tgt: target channel object 814*5113495bSYour Name * @src: src achannel object 815*5113495bSYour Name * 816*5113495bSYour Name * This function copies channel data from src to tgt 817*5113495bSYour Name * 818*5113495bSYour Name * Return: void 819*5113495bSYour Name */ 820*5113495bSYour Name void wlan_chan_copy(struct wlan_channel *tgt, struct wlan_channel *src); 821*5113495bSYour Name 822*5113495bSYour Name /** 823*5113495bSYour Name * wlan_vdev_get_active_channel() - derives the vdev operating channel 824*5113495bSYour Name * @vdev: VDEV object 825*5113495bSYour Name * 826*5113495bSYour Name * This function checks vdev state and return the channel pointer accordingly 827*5113495bSYour Name * 828*5113495bSYour Name * Return: active channel, if vdev chan config is valid 829*5113495bSYour Name * NULL, if VDEV is in INIT or STOP state 830*5113495bSYour Name */ 831*5113495bSYour Name struct wlan_channel *wlan_vdev_get_active_channel 832*5113495bSYour Name (struct wlan_objmgr_vdev *vdev); 833*5113495bSYour Name 834*5113495bSYour Name /** 835*5113495bSYour Name * wlan_get_connected_vdev_by_bssid() - check/get any vdev connected on bssid 836*5113495bSYour Name * @pdev: pdev object 837*5113495bSYour Name * @bssid: bssid to be checked 838*5113495bSYour Name * @vdev_id: vdev id 839*5113495bSYour Name * 840*5113495bSYour Name * This function will loop through all the vdev in psoc and find/return the 841*5113495bSYour Name * vdev which is connected to bssid provided. 842*5113495bSYour Name * 843*5113495bSYour Name * Return: bool 844*5113495bSYour Name */ 845*5113495bSYour Name bool wlan_get_connected_vdev_by_bssid(struct wlan_objmgr_pdev *pdev, 846*5113495bSYour Name uint8_t *bssid, uint8_t *vdev_id); 847*5113495bSYour Name 848*5113495bSYour Name /** 849*5113495bSYour Name * wlan_get_connected_vdev_from_psoc_by_bssid() - check/get any vdev 850*5113495bSYour Name * connected on bssid 851*5113495bSYour Name * @psoc: psoc object 852*5113495bSYour Name * @bssid: bssid to be checked 853*5113495bSYour Name * @vdev_id: vdev id 854*5113495bSYour Name * 855*5113495bSYour Name * This function will loop through all the vdev in psoc and find/return the 856*5113495bSYour Name * vdev which is connected to bssid provided. 857*5113495bSYour Name * 858*5113495bSYour Name * Return: bool 859*5113495bSYour Name */ 860*5113495bSYour Name bool wlan_get_connected_vdev_from_psoc_by_bssid(struct wlan_objmgr_psoc *psoc, 861*5113495bSYour Name uint8_t *bssid, 862*5113495bSYour Name uint8_t *vdev_id); 863*5113495bSYour Name 864*5113495bSYour Name #ifdef WLAN_FEATURE_11BE_MLO 865*5113495bSYour Name /** 866*5113495bSYour Name * wlan_get_connected_vdev_by_mld_addr() - check/get any vdev 867*5113495bSYour Name * connected on mld mac 868*5113495bSYour Name * @psoc: psoc object 869*5113495bSYour Name * @mld_mac: mld mac to be checked 870*5113495bSYour Name * @vdev_id: vdev id 871*5113495bSYour Name * 872*5113495bSYour Name * This function will loop through all the vdev in psoc and find/return the 873*5113495bSYour Name * first vdev which is connected to mld mac provided. 874*5113495bSYour Name * 875*5113495bSYour Name * Return: bool 876*5113495bSYour Name */ 877*5113495bSYour Name bool wlan_get_connected_vdev_by_mld_addr(struct wlan_objmgr_psoc *psoc, 878*5113495bSYour Name uint8_t *mld_mac, uint8_t *vdev_id); 879*5113495bSYour Name #endif 880*5113495bSYour Name 881*5113495bSYour Name /** 882*5113495bSYour Name * wlan_util_stats_get_rssi() - API to get rssi in dbm 883*5113495bSYour Name * @db2dbm_enabled: If db2dbm capability is enabled 884*5113495bSYour Name * @bcn_snr: beacon snr 885*5113495bSYour Name * @dat_snr: data snr 886*5113495bSYour Name * @rssi: rssi 887*5113495bSYour Name * 888*5113495bSYour Name * This function gets the rssi based on db2dbm support. If this feature is 889*5113495bSYour Name * present in hw then it means firmware directly sends rssi and no conversion 890*5113495bSYour Name * is required. If this capability is not present then host needs to convert 891*5113495bSYour Name * snr to rssi 892*5113495bSYour Name * 893*5113495bSYour Name * Return: None 894*5113495bSYour Name */ 895*5113495bSYour Name void 896*5113495bSYour Name wlan_util_stats_get_rssi(bool db2dbm_enabled, int32_t bcn_snr, int32_t dat_snr, 897*5113495bSYour Name int8_t *rssi); 898*5113495bSYour Name 899*5113495bSYour Name /** 900*5113495bSYour Name * wlan_util_is_pdev_restart_progress() - Check if any vdev is in restart state 901*5113495bSYour Name * @pdev: pdev pointer 902*5113495bSYour Name * @dbg_id: module id 903*5113495bSYour Name * 904*5113495bSYour Name * Iterates through all vdevs, checks if any VDEV is in RESTART_PROGRESS 905*5113495bSYour Name * substate 906*5113495bSYour Name * 907*5113495bSYour Name * Return: QDF_STATUS_SUCCESS,if any vdev is in RESTART_PROGRESS substate 908*5113495bSYour Name * otherwise QDF_STATUS_E_FAILURE 909*5113495bSYour Name */ 910*5113495bSYour Name QDF_STATUS wlan_util_is_pdev_restart_progress(struct wlan_objmgr_pdev *pdev, 911*5113495bSYour Name wlan_objmgr_ref_dbgid dbg_id); 912*5113495bSYour Name 913*5113495bSYour Name /** 914*5113495bSYour Name * wlan_util_is_pdev_scan_allowed() - Check for vdev is allowed to scan 915*5113495bSYour Name * @pdev: pdev pointer 916*5113495bSYour Name * @dbg_id: module id 917*5113495bSYour Name * 918*5113495bSYour Name * Iterates through all vdevs, checks if any VDEV is not either in S_INIT or in 919*5113495bSYour Name * S_UP state 920*5113495bSYour Name * 921*5113495bSYour Name * Return: QDF_STATUS_SUCCESS,if scan is allowed, otherwise QDF_STATUS_E_FAILURE 922*5113495bSYour Name */ 923*5113495bSYour Name QDF_STATUS wlan_util_is_pdev_scan_allowed(struct wlan_objmgr_pdev *pdev, 924*5113495bSYour Name wlan_objmgr_ref_dbgid dbg_id); 925*5113495bSYour Name 926*5113495bSYour Name /** 927*5113495bSYour Name * wlan_util_get_peer_count_for_mode - This api gives vdev mode specific 928*5113495bSYour Name * peer count` 929*5113495bSYour Name * @pdev: PDEV object 930*5113495bSYour Name * @mode: Operation mode. 931*5113495bSYour Name * 932*5113495bSYour Name * Return: int- peer count for operating mode 933*5113495bSYour Name */ 934*5113495bSYour Name uint16_t wlan_util_get_peer_count_for_mode(struct wlan_objmgr_pdev *pdev, 935*5113495bSYour Name enum QDF_OPMODE mode); 936*5113495bSYour Name 937*5113495bSYour Name /** 938*5113495bSYour Name * enum wlan_minidump_host_data - Data structure type logged in Minidump 939*5113495bSYour Name * @WLAN_MD_CP_EXT_PDEV: ol_ath_softc_net80211 940*5113495bSYour Name * @WLAN_MD_CP_EXT_PSOC: ol_ath_soc_softc 941*5113495bSYour Name * @WLAN_MD_CP_EXT_VDEV: ieee80211vap 942*5113495bSYour Name * @WLAN_MD_CP_EXT_PEER: ieee80211_node 943*5113495bSYour Name * @WLAN_MD_DP_SOC: dp_soc 944*5113495bSYour Name * @WLAN_MD_DP_PDEV: dp_pdev 945*5113495bSYour Name * @WLAN_MD_DP_VDEV: dp_vdev 946*5113495bSYour Name * @WLAN_MD_DP_PEER: dp_peer 947*5113495bSYour Name * @WLAN_MD_DP_SRNG_REO_DEST: dp_srng type for reo dest 948*5113495bSYour Name * @WLAN_MD_DP_SRNG_REO_EXCEPTION: dp_srng type for reo exception 949*5113495bSYour Name * @WLAN_MD_DP_SRNG_REO_CMD: dp_srng type for reo cmd 950*5113495bSYour Name * @WLAN_MD_DP_SRNG_RX_REL: dp_srng type for reo release 951*5113495bSYour Name * @WLAN_MD_DP_SRNG_REO_REINJECT: dp_srng type for reo reinject 952*5113495bSYour Name * @WLAN_MD_DP_SRNG_REO_STATUS: dp_srng type for reo status 953*5113495bSYour Name * @WLAN_MD_DP_SRNG_TCL_DATA: dp_srng type for tcl data 954*5113495bSYour Name * @WLAN_MD_DP_SRNG_TCL_CMD: dp_srng type for tcl cmd 955*5113495bSYour Name * @WLAN_MD_DP_SRNG_TCL_STATUS: dp_srng type for tcl status 956*5113495bSYour Name * @WLAN_MD_DP_SRNG_TX_COMP: dp_srng type for tcl comp 957*5113495bSYour Name * @WLAN_MD_DP_SRNG_WBM_DESC_REL: dp_srng_type for wbm desc rel 958*5113495bSYour Name * @WLAN_MD_DP_SRNG_WBM_IDLE_LINK: dp_srng type for wbm idle link 959*5113495bSYour Name * @WLAN_MD_DP_LINK_DESC_BANK: Wbm link_desc_bank 960*5113495bSYour Name * @WLAN_MD_DP_SRNG_RXDMA_MON_STATUS: dp_srng type for rxdma mon status 961*5113495bSYour Name * @WLAN_MD_DP_SRNG_RXDMA_MON_BUF: dp_srng type for rxdma mon buf 962*5113495bSYour Name * @WLAN_MD_DP_SRNG_RXDMA_MON_DST: dp_srng type for rxdma mon dest 963*5113495bSYour Name * @WLAN_MD_DP_SRNG_RXDMA_MON_DESC: dp_srng type for rxdma mon desc 964*5113495bSYour Name * @WLAN_MD_DP_SRNG_RXDMA_ERR_DST: dp_srng type for rxdma err dst 965*5113495bSYour Name * @WLAN_MD_DP_HAL_SOC: hal_soc 966*5113495bSYour Name * @WLAN_MD_OBJMGR_PSOC: wlan_objmgr_psoc 967*5113495bSYour Name * @WLAN_MD_OBJMGR_PSOC_TGT_INFO: wlan_objmgr_tgt_psoc_info 968*5113495bSYour Name * @WLAN_MD_OBJMGR_PDEV: wlan_objmgr_pdev 969*5113495bSYour Name * @WLAN_MD_OBJMGR_PDEV_MLME: pdev_mlme 970*5113495bSYour Name * @WLAN_MD_OBJMGR_VDEV: wlan_objmgr_vdev 971*5113495bSYour Name * @WLAN_MD_OBJMGR_VDEV_MLME: vdev mlme 972*5113495bSYour Name * @WLAN_MD_OBJMGR_VDEV_SM: wlan_sm 973*5113495bSYour Name * @WLAN_MD_DP_SRNG_REO2PPE: dp_srng type PPE rx ring 974*5113495bSYour Name * @WLAN_MD_DP_SRNG_PPE2TCL: dp_srng type for PPE tx ring 975*5113495bSYour Name * @WLAN_MD_DP_SRNG_PPE_RELEASE: dp_srng type for PPE tx com ring 976*5113495bSYour Name * @WLAN_MD_DP_SRNG_PPE_WBM2SW_RELEASE: dp_srng type for PPE2TCL tx com ring 977*5113495bSYour Name * @WLAN_MD_DP_SRNG_SW2RXDMA_LINK_RING: dp_srng type for SW2RXDMA link ring 978*5113495bSYour Name * @WLAN_MD_MAX: Max value 979*5113495bSYour Name */ 980*5113495bSYour Name enum wlan_minidump_host_data { 981*5113495bSYour Name WLAN_MD_CP_EXT_PDEV, 982*5113495bSYour Name WLAN_MD_CP_EXT_PSOC, 983*5113495bSYour Name WLAN_MD_CP_EXT_VDEV, 984*5113495bSYour Name WLAN_MD_CP_EXT_PEER, 985*5113495bSYour Name WLAN_MD_DP_SOC, 986*5113495bSYour Name WLAN_MD_DP_PDEV, 987*5113495bSYour Name WLAN_MD_DP_VDEV, 988*5113495bSYour Name WLAN_MD_DP_PEER, 989*5113495bSYour Name WLAN_MD_DP_SRNG_REO_DEST, 990*5113495bSYour Name WLAN_MD_DP_SRNG_REO_EXCEPTION, 991*5113495bSYour Name WLAN_MD_DP_SRNG_REO_CMD, 992*5113495bSYour Name WLAN_MD_DP_SRNG_RX_REL, 993*5113495bSYour Name WLAN_MD_DP_SRNG_REO_REINJECT, 994*5113495bSYour Name WLAN_MD_DP_SRNG_REO_STATUS, 995*5113495bSYour Name WLAN_MD_DP_SRNG_TCL_DATA, 996*5113495bSYour Name WLAN_MD_DP_SRNG_TCL_CMD, 997*5113495bSYour Name WLAN_MD_DP_SRNG_TCL_STATUS, 998*5113495bSYour Name WLAN_MD_DP_SRNG_TX_COMP, 999*5113495bSYour Name WLAN_MD_DP_SRNG_WBM_DESC_REL, 1000*5113495bSYour Name WLAN_MD_DP_SRNG_WBM_IDLE_LINK, 1001*5113495bSYour Name WLAN_MD_DP_LINK_DESC_BANK, 1002*5113495bSYour Name WLAN_MD_DP_SRNG_RXDMA_MON_STATUS, 1003*5113495bSYour Name WLAN_MD_DP_SRNG_RXDMA_MON_BUF, 1004*5113495bSYour Name WLAN_MD_DP_SRNG_RXDMA_MON_DST, 1005*5113495bSYour Name WLAN_MD_DP_SRNG_RXDMA_MON_DESC, 1006*5113495bSYour Name WLAN_MD_DP_SRNG_RXDMA_ERR_DST, 1007*5113495bSYour Name WLAN_MD_DP_HAL_SOC, 1008*5113495bSYour Name WLAN_MD_OBJMGR_PSOC, 1009*5113495bSYour Name WLAN_MD_OBJMGR_PSOC_TGT_INFO, 1010*5113495bSYour Name WLAN_MD_OBJMGR_PDEV, 1011*5113495bSYour Name WLAN_MD_OBJMGR_PDEV_MLME, 1012*5113495bSYour Name WLAN_MD_OBJMGR_VDEV, 1013*5113495bSYour Name WLAN_MD_OBJMGR_VDEV_MLME, 1014*5113495bSYour Name WLAN_MD_OBJMGR_VDEV_SM, 1015*5113495bSYour Name WLAN_MD_DP_SRNG_REO2PPE, 1016*5113495bSYour Name WLAN_MD_DP_SRNG_PPE2TCL, 1017*5113495bSYour Name WLAN_MD_DP_SRNG_PPE_RELEASE, 1018*5113495bSYour Name WLAN_MD_DP_SRNG_PPE_WBM2SW_RELEASE, 1019*5113495bSYour Name WLAN_MD_DP_SRNG_SW2RXDMA_LINK_RING, 1020*5113495bSYour Name WLAN_MD_MAX 1021*5113495bSYour Name }; 1022*5113495bSYour Name 1023*5113495bSYour Name /** 1024*5113495bSYour Name * wlan_minidump_log() - Log memory address to be included in minidump 1025*5113495bSYour Name * @start_addr: Start address of the memory to be dumped 1026*5113495bSYour Name * @size: Size in bytes 1027*5113495bSYour Name * @psoc_obj: Psoc Object 1028*5113495bSYour Name * @type: Type of data structure 1029*5113495bSYour Name * @name: String to identify this entry 1030*5113495bSYour Name */ 1031*5113495bSYour Name void wlan_minidump_log(void *start_addr, const size_t size, 1032*5113495bSYour Name void *psoc_obj, 1033*5113495bSYour Name enum wlan_minidump_host_data type, 1034*5113495bSYour Name const char *name); 1035*5113495bSYour Name 1036*5113495bSYour Name /** 1037*5113495bSYour Name * wlan_minidump_remove() - Remove memory address from minidump 1038*5113495bSYour Name * @start_addr: Start address of the memory previously added 1039*5113495bSYour Name * @size: Size in bytes 1040*5113495bSYour Name * @psoc_obj: Psoc Object 1041*5113495bSYour Name * @type: Type of data structure 1042*5113495bSYour Name * @name: String to identify this entry 1043*5113495bSYour Name */ 1044*5113495bSYour Name void wlan_minidump_remove(void *start_addr, const size_t size, 1045*5113495bSYour Name void *psoc_obj, 1046*5113495bSYour Name enum wlan_minidump_host_data type, 1047*5113495bSYour Name const char *name); 1048*5113495bSYour Name 1049*5113495bSYour Name /** 1050*5113495bSYour Name * wlan_util_is_vdev_in_cac_wait() - Check if dfs sap vdev is in cac wait 1051*5113495bSYour Name * @pdev: pdev object 1052*5113495bSYour Name * @dbg_id: object manager ref id 1053*5113495bSYour Name * 1054*5113495bSYour Name * This function checks if dfs sap vdev is in cac wait state 1055*5113495bSYour Name * 1056*5113495bSYour Name * Return: true, if cac is in progress, otherwise false 1057*5113495bSYour Name */ 1058*5113495bSYour Name bool wlan_util_is_vdev_in_cac_wait(struct wlan_objmgr_pdev *pdev, 1059*5113495bSYour Name wlan_objmgr_ref_dbgid dbg_id); 1060*5113495bSYour Name 1061*5113495bSYour Name /** 1062*5113495bSYour Name * wlan_eht_chan_phy_mode - convert eht chan to phy mode 1063*5113495bSYour Name * @freq: frequency 1064*5113495bSYour Name * @bw_val: bandwidth 1065*5113495bSYour Name * @chan_width: channel width 1066*5113495bSYour Name * 1067*5113495bSYour Name * Return: return phy mode 1068*5113495bSYour Name */ 1069*5113495bSYour Name enum wlan_phymode 1070*5113495bSYour Name wlan_eht_chan_phy_mode(uint32_t freq, 1071*5113495bSYour Name uint16_t bw_val, 1072*5113495bSYour Name enum phy_ch_width chan_width); 1073*5113495bSYour Name #endif /* _WLAN_UTILITY_H_ */ 1074