// SPDX-License-Identifier: GPL-2.0-only /* * NXP Wireless LAN device driver: utility functions * * Copyright 2011-2020 NXP */ #include "decl.h" #include "ioctl.h" #include "util.h" #include "fw.h" #include "main.h" #include "wmm.h" #include "11n.h" static struct mwifiex_debug_data items[] = …; static int num_of_items = …; /* * Firmware initialization complete callback handler. * * This function wakes up the function waiting on the init * wait queue for the firmware initialization to complete. */ int mwifiex_init_fw_complete(struct mwifiex_adapter *adapter) { … } /* * This function sends init/shutdown command * to firmware. */ int mwifiex_init_shutdown_fw(struct mwifiex_private *priv, u32 func_init_shutdown) { … } EXPORT_SYMBOL_GPL(…); /* * IOCTL request handler to set/get debug information. * * This function collates/sets the information from/to different driver * structures. */ int mwifiex_get_debug_info(struct mwifiex_private *priv, struct mwifiex_debug_info *info) { … } int mwifiex_debug_info_to_buffer(struct mwifiex_private *priv, char *buf, struct mwifiex_debug_info *info) { … } static int mwifiex_parse_mgmt_packet(struct mwifiex_private *priv, u8 *payload, u16 len, struct rxpd *rx_pd) { … } /* * This function processes the received management packet and send it * to the kernel. */ int mwifiex_process_mgmt_packet(struct mwifiex_private *priv, struct sk_buff *skb) { … } /* * This function processes the received packet before sending it to the * kernel. * * It extracts the SKB from the received buffer and sends it to kernel. * In case the received buffer does not contain the data in SKB format, * the function creates a blank SKB, fills it with the data from the * received buffer and then sends this new SKB to the kernel. */ int mwifiex_recv_packet(struct mwifiex_private *priv, struct sk_buff *skb) { … } /* * IOCTL completion callback handler. * * This function is called when a pending IOCTL is completed. * * If work queue support is enabled, the function wakes up the * corresponding waiting function. Otherwise, it processes the * IOCTL response and frees the response buffer. */ int mwifiex_complete_cmd(struct mwifiex_adapter *adapter, struct cmd_ctrl_node *cmd_node) { … } /* This function will return the pointer to station entry in station list * table which matches specified mac address. * This function should be called after acquiring RA list spinlock. * NULL is returned if station entry is not found in associated STA list. */ struct mwifiex_sta_node * mwifiex_get_sta_entry(struct mwifiex_private *priv, const u8 *mac) { … } static struct mwifiex_sta_node * mwifiex_get_tdls_sta_entry(struct mwifiex_private *priv, u8 status) { … } /* If tdls channel switching is on-going, tx data traffic should be * blocked until the switching stage completed. */ u8 mwifiex_is_tdls_chan_switching(struct mwifiex_private *priv) { … } u8 mwifiex_is_tdls_off_chan(struct mwifiex_private *priv) { … } /* If tdls channel switching is on-going or tdls operate on off-channel, * cmd path should be blocked until tdls switched to base-channel. */ u8 mwifiex_is_send_cmd_allowed(struct mwifiex_private *priv) { … } /* This function will add a sta_node entry to associated station list * table with the given mac address. * If entry exist already, existing entry is returned. * If received mac address is NULL, NULL is returned. */ struct mwifiex_sta_node * mwifiex_add_sta_entry(struct mwifiex_private *priv, const u8 *mac) { … } /* This function will search for HT IE in association request IEs * and set station HT parameters accordingly. */ void mwifiex_set_sta_ht_cap(struct mwifiex_private *priv, const u8 *ies, int ies_len, struct mwifiex_sta_node *node) { … } /* This function will delete a station entry from station list */ void mwifiex_del_sta_entry(struct mwifiex_private *priv, const u8 *mac) { … } /* This function will delete all stations from associated station list. */ void mwifiex_del_all_sta_list(struct mwifiex_private *priv) { … } /* This function adds histogram data to histogram array*/ void mwifiex_hist_data_add(struct mwifiex_private *priv, u8 rx_rate, s8 snr, s8 nflr) { … } /* function to add histogram record */ void mwifiex_hist_data_set(struct mwifiex_private *priv, u8 rx_rate, s8 snr, s8 nflr) { … } /* function to reset histogram data during init/reset */ void mwifiex_hist_data_reset(struct mwifiex_private *priv) { … } void *mwifiex_alloc_dma_align_buf(int rx_len, gfp_t flags) { … } EXPORT_SYMBOL_GPL(…); void mwifiex_fw_dump_event(struct mwifiex_private *priv) { … } EXPORT_SYMBOL_GPL(…);