// SPDX-License-Identifier: GPL-2.0-only /* * NXP Wireless LAN device driver: HW/FW Initialization * * 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" /* * This function adds a BSS priority table to the table list. * * The function allocates a new BSS priority table node and adds it to * the end of BSS priority table list, kept in driver memory. */ static int mwifiex_add_bss_prio_tbl(struct mwifiex_private *priv) { … } static void wakeup_timer_fn(struct timer_list *t) { … } static void fw_dump_work(struct work_struct *work) { … } /* * This function initializes the private structure and sets default * values to the members. * * Additionally, it also initializes all the locks and sets up all the * lists. */ int mwifiex_init_priv(struct mwifiex_private *priv) { … } /* * This function allocates buffers for members of the adapter * structure. * * The memory allocated includes scan table, command buffers, and * sleep confirm command buffer. In addition, the queues are * also initialized. */ static int mwifiex_allocate_adapter(struct mwifiex_adapter *adapter) { … } /* * This function initializes the adapter structure and sets default * values to the members of adapter. * * This also initializes the WMM related parameters in the driver private * structures. */ static void mwifiex_init_adapter(struct mwifiex_adapter *adapter) { … } /* * This function sets trans_start per tx_queue */ void mwifiex_set_trans_start(struct net_device *dev) { … } /* * This function wakes up all queues in net_device */ void mwifiex_wake_up_net_dev_queue(struct net_device *netdev, struct mwifiex_adapter *adapter) { … } /* * This function stops all queues in net_device */ void mwifiex_stop_net_dev_queue(struct net_device *netdev, struct mwifiex_adapter *adapter) { … } /* * This function invalidates the list heads. */ static void mwifiex_invalidate_lists(struct mwifiex_adapter *adapter) { … } /* * This function performs cleanup for adapter structure. * * The cleanup is done recursively, by canceling all pending * commands, freeing the member buffers previously allocated * (command buffers, scan table buffer, sleep confirm command * buffer), stopping the timers and calling the cleanup routines * for every interface. */ static void mwifiex_adapter_cleanup(struct mwifiex_adapter *adapter) { … } void mwifiex_free_cmd_buffers(struct mwifiex_adapter *adapter) { … } /* * This function intializes the lock variables and * the list heads. */ int mwifiex_init_lock_list(struct mwifiex_adapter *adapter) { … } /* * This function initializes the firmware. * * The following operations are performed sequentially - * - Allocate adapter structure * - Initialize the adapter structure * - Initialize the private structure * - Add BSS priority tables to the adapter structure * - For each interface, send the init commands to firmware * - Send the first command in command pending queue, if available */ int mwifiex_init_fw(struct mwifiex_adapter *adapter) { … } /* * This function deletes the BSS priority tables. * * The function traverses through all the allocated BSS priority nodes * in every BSS priority table and frees them. */ static void mwifiex_delete_bss_prio_tbl(struct mwifiex_private *priv) { … } /* * This function frees the private structure, including cleans * up the TX and RX queues and frees the BSS priority tables. */ void mwifiex_free_priv(struct mwifiex_private *priv) { … } /* * This function is used to shutdown the driver. * * The following operations are performed sequentially - * - Check if already shut down * - Make sure the main process has stopped * - Clean up the Tx and Rx queues * - Delete BSS priority tables * - Free the adapter * - Notify completion */ void mwifiex_shutdown_drv(struct mwifiex_adapter *adapter) { … } /* * This function downloads the firmware to the card. * * The actual download is preceded by two sanity checks - * - Check if firmware is already running * - Check if the interface is the winner to download the firmware * * ...and followed by another - * - Check if the firmware is downloaded successfully * * After download is successfully completed, the host interrupts are enabled. */ int mwifiex_dnld_fw(struct mwifiex_adapter *adapter, struct mwifiex_fw_image *pmfw) { … } EXPORT_SYMBOL_GPL(…);