From 533d1ffe41a39b267e375091cea7198cf1e4c04d Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Wed, 8 Sep 2010 22:05:21 +0900 Subject: [PATCH] Staging: rtl8192e: Less verbose function headers Signed-off-by: Mike McCormack Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/r8192E_dm.c | 221 ++++------------------------- drivers/staging/rtl8192e/r819xE_cmdpkt.c | 213 ++++++--------------------- drivers/staging/rtl8192e/r819xE_firmware.c | 26 +--- 3 files changed, 75 insertions(+), 385 deletions(-) diff --git a/drivers/staging/rtl8192e/r8192E_dm.c b/drivers/staging/rtl8192e/r8192E_dm.c index 0d66faf..0f7bc52 100644 --- a/drivers/staging/rtl8192e/r8192E_dm.c +++ b/drivers/staging/rtl8192e/r8192E_dm.c @@ -145,18 +145,10 @@ static void dm_dynamic_txpower(struct net_device *dev); static void dm_send_rssi_tofw(struct net_device *dev); static void dm_ctstoself(struct net_device *dev); -//================================================================================ -// HW Dynamic mechanism interface. -//================================================================================ - -// -// Description: -// Prepare SW resource for HW dynamic mechanism. -// -// Assumption: -// This function is only invoked at driver intialization once. -// -// +/* + * Prepare SW resource for HW dynamic mechanism. + * This function is only invoked at driver intialization once. + */ void init_hal_dm(struct net_device *dev) { struct r8192_priv *priv = ieee80211_priv(dev); @@ -350,22 +342,6 @@ void init_rate_adaptive(struct net_device * dev) } -/*----------------------------------------------------------------------------- - * Function: dm_check_rate_adaptive() - * - * Overview: - * - * Input: NONE - * - * Output: NONE - * - * Return: NONE - * - * Revised History: - * When Who Remark - * 05/26/08 amy Create version 0 proting from windows code. - * - *---------------------------------------------------------------------------*/ static void dm_check_rate_adaptive(struct net_device * dev) { struct r8192_priv *priv = ieee80211_priv(dev); @@ -1891,22 +1867,7 @@ static void dm_bb_initialgain_backup(struct net_device *dev) } #endif -/*----------------------------------------------------------------------------- - * Function: dm_change_dynamic_initgain_thresh() - * - * Overview: - * - * Input: NONE - * - * Output: NONE - * - * Return: NONE - * - * Revised History: - * When Who Remark - * 05/29/2008 amy Create Version 0 porting from windows code. - * - *---------------------------------------------------------------------------*/ + void dm_change_dynamic_initgain_thresh(struct net_device *dev, u32 dm_type, u32 dm_value) { if (dm_type == DIG_TYPE_THRESH_HIGH) @@ -1976,22 +1937,7 @@ void dm_change_dynamic_initgain_thresh(struct net_device *dev, u32 dm_type, u32 } -/*----------------------------------------------------------------------------- - * Function: dm_dig_init() - * - * Overview: Set DIG scheme init value. - * - * Input: NONE - * - * Output: NONE - * - * Return: NONE - * - * Revised History: - * When Who Remark - * 05/15/2008 amy Create Version 0 porting from windows code. - * - *---------------------------------------------------------------------------*/ +/* Set DIG scheme init value. */ static void dm_dig_init(struct net_device *dev) { struct r8192_priv *priv = ieee80211_priv(dev); @@ -2023,23 +1969,11 @@ static void dm_dig_init(struct net_device *dev) } -/*----------------------------------------------------------------------------- - * Function: dm_ctrl_initgain_byrssi() - * - * Overview: Driver must monitor RSSI and notify firmware to change initial - * gain according to different threshold. BB team provide the - * suggested solution. - * - * Input: struct net_device *dev - * - * Output: NONE - * - * Return: NONE - * - * Revised History: - * When Who Remark - * 05/27/2008 amy Create Version 0 porting from windows code. - *---------------------------------------------------------------------------*/ +/* + * Driver must monitor RSSI and notify firmware to change initial + * gain according to different threshold. BB team provide the + * suggested solution. + */ static void dm_ctrl_initgain_byrssi(struct net_device *dev) { @@ -2265,23 +2199,6 @@ static void dm_ctrl_initgain_byrssi_by_fwfalse_alarm( } - -/*----------------------------------------------------------------------------- - * Function: dm_ctrl_initgain_byrssi_highpwr() - * - * Overview: - * - * Input: NONE - * - * Output: NONE - * - * Return: NONE - * - * Revised History: - * When Who Remark - * 05/28/2008 amy Create Version 0 porting from windows code. - * - *---------------------------------------------------------------------------*/ static void dm_ctrl_initgain_byrssi_highpwr( struct net_device * dev) { @@ -2785,22 +2702,7 @@ static void dm_ctstoself(struct net_device *dev) -/*----------------------------------------------------------------------------- - * Function: dm_check_rfctrl_gpio() - * - * Overview: Copy 8187B template for 9xseries. - * - * Input: NONE - * - * Output: NONE - * - * Return: NONE - * - * Revised History: - * When Who Remark - * 05/28/2008 amy Create Version 0 porting from windows code. - * - *---------------------------------------------------------------------------*/ +/* Copy 8187B template for 9xseries */ #if 1 static void dm_check_rfctrl_gpio(struct net_device * dev) { @@ -2826,22 +2728,7 @@ static void dm_check_rfctrl_gpio(struct net_device * dev) } #endif -/*----------------------------------------------------------------------------- - * Function: dm_check_pbc_gpio() - * - * Overview: Check if PBC button is pressed. - * - * Input: NONE - * - * Output: NONE - * - * Return: NONE - * - * Revised History: - * When Who Remark - * 05/28/2008 amy Create Version 0 porting from windows code. - * - *---------------------------------------------------------------------------*/ +/* Check if PBC button is pressed. */ static void dm_check_pbc_gpio(struct net_device *dev) { #ifdef RTL8192U @@ -2866,26 +2753,12 @@ static void dm_check_pbc_gpio(struct net_device *dev) #ifdef RTL8192E -/*----------------------------------------------------------------------------- - * Function: dm_GPIOChangeRF - * Overview: PCI will not support workitem call back HW radio on-off control. - * - * Input: NONE - * - * Output: NONE - * - * Return: NONE - * - * Revised History: - * When Who Remark - * 02/21/2008 MHC Create Version 0. - * - *---------------------------------------------------------------------------*/ +/* PCI will not support workitem call back HW radio on-off control. */ void dm_gpio_change_rf_callback(struct work_struct *work) { struct delayed_work *dwork = container_of(work,struct delayed_work,work); - struct r8192_priv *priv = container_of(dwork,struct r8192_priv,gpio_change_rf_wq); - struct net_device *dev = priv->ieee80211->dev; + struct r8192_priv *priv = container_of(dwork,struct r8192_priv,gpio_change_rf_wq); + struct net_device *dev = priv->ieee80211->dev; u8 tmp1byte; RT_RF_POWER_STATE eRfPowerStateToSet; bool bActuallySet = false; @@ -2921,22 +2794,8 @@ void dm_gpio_change_rf_callback(struct work_struct *work) } #endif -/*----------------------------------------------------------------------------- - * Function: DM_RFPathCheckWorkItemCallBack() - * - * Overview: Check if Current RF RX path is enabled - * - * Input: NONE - * - * Output: NONE - * - * Return: NONE - * - * Revised History: - * When Who Remark - * 01/30/2008 MHC Create Version 0. - * - *---------------------------------------------------------------------------*/ + +/* Check if Current RF RX path is enabled */ void dm_rf_pathcheck_workitemcallback(struct work_struct *work) { struct delayed_work *dwork = container_of(work,struct delayed_work,work); @@ -3247,29 +3106,15 @@ static void dm_rxpath_sel_byrssi(struct net_device * dev) } } -/*----------------------------------------------------------------------------- - * Function: dm_check_rx_path_selection() - * - * Overview: Call a workitem to check current RXRF path and Rx Path selection by RSSI. - * - * Input: NONE - * - * Output: NONE - * - * Return: NONE - * - * Revised History: - * When Who Remark - * 05/28/2008 amy Create Version 0 porting from windows code. - * - *---------------------------------------------------------------------------*/ -static void dm_check_rx_path_selection(struct net_device *dev) +/* + * Call a workitem to check current RXRF path and Rx Path selection by RSSI. + */ +static void dm_check_rx_path_selection(struct net_device *dev) { struct r8192_priv *priv = ieee80211_priv(dev); queue_delayed_work(priv->priv_wq,&priv->rfpath_check_wq,0); } - static void dm_init_fsync (struct net_device *dev) { struct r8192_priv *priv = ieee80211_priv(dev); @@ -3664,24 +3509,10 @@ void dm_check_fsync(struct net_device *dev) } } -/*---------------------------Define function prototype------------------------*/ -/*----------------------------------------------------------------------------- - * Function: DM_DynamicTxPower() - * - * Overview: Detect Signal strength to control TX Registry - Tx Power Control For Near/Far Range - * - * Input: NONE - * - * Output: NONE - * - * Return: NONE - * - * Revised History: - * When Who Remark - * 03/06/2008 Jacken Create Version 0. - * - *---------------------------------------------------------------------------*/ +/* + * Detect Signal strength to control TX Registry + * Tx Power Control For Near/Far Range + */ static void dm_init_dynamic_txpower(struct net_device *dev) { struct r8192_priv *priv = ieee80211_priv(dev); diff --git a/drivers/staging/rtl8192e/r819xE_cmdpkt.c b/drivers/staging/rtl8192e/r819xE_cmdpkt.c index adaebe0..135439d 100644 --- a/drivers/staging/rtl8192e/r819xE_cmdpkt.c +++ b/drivers/staging/rtl8192e/r819xE_cmdpkt.c @@ -25,26 +25,13 @@ #include "r8192E_hw.h" #include "r819xE_cmdpkt.h" -/*----------------------------------------------------------------------------- - * Function: cmpk_message_handle_tx() - * - * Overview: Driver internal module can call the API to send message to - * firmware side. For example, you can send a debug command packet. - * Or you can send a request for FW to modify RLX4181 LBUS HW bank. - * Otherwise, you can change MAC/PHT/RF register by firmware at - * run time. We do not support message more than one segment now. - * - * Input: NONE - * - * Output: NONE - * - * Return: NONE - * - * Revised History: - * When Who Remark - * 05/06/2008 amy porting from windows code. - * - *---------------------------------------------------------------------------*/ +/* + * Driver internal module can call the API to send message to + * firmware side. For example, you can send a debug command packet. + * Or you can send a request for FW to modify RLX4181 LBUS HW bank. + * Otherwise, you can change MAC/PHT/RF register by firmware at + * run time. We do not support message more than one segment now. + */ RT_STATUS cmpk_message_handle_tx( struct net_device *dev, u8* code_virtual_address, @@ -144,24 +131,7 @@ Failed: #endif } -/*----------------------------------------------------------------------------- - * Function: cmpk_counttxstatistic() - * - * Overview: - * - * Input: PADAPTER pAdapter - . - * CMPK_TXFB_T *psTx_FB - . - * - * Output: NONE - * - * Return: NONE - * - * Revised History: - * When Who Remark - * 05/12/2008 amy Create Version 0 porting from windows code. - * - *---------------------------------------------------------------------------*/ -static void +static void cmpk_count_txstatistic( struct net_device *dev, cmpk_txfb_t *pstx_fb) @@ -240,28 +210,14 @@ cmpk_count_txstatistic( -/*----------------------------------------------------------------------------- - * Function: cmpk_handle_tx_feedback() - * - * Overview: The function is responsible for extract the message inside TX - * feedbck message from firmware. It will contain dedicated info in - * ws-06-0063-rtl8190-command-packet-specification. Please - * refer to chapter "TX Feedback Element". We have to read 20 bytes - * in the command packet. - * - * Input: struct net_device * dev - * u8 * pmsg - Msg Ptr of the command packet. - * - * Output: NONE - * - * Return: NONE - * - * Revised History: - * When Who Remark - * 05/08/2008 amy Create Version 0 porting from windows code. - * - *---------------------------------------------------------------------------*/ -static void +/* + * The function is responsible for extract the message inside TX + * feedbck message from firmware. It will contain dedicated info in + * ws-06-0063-rtl8190-command-packet-specification. Please + * refer to chapter "TX Feedback Element". We have to read 20 bytes + * in the command packet. + */ +static void cmpk_handle_tx_feedback( struct net_device *dev, u8 * pmsg) @@ -323,26 +279,12 @@ cmpk_handle_tx_feedback( } -/*----------------------------------------------------------------------------- - * Function: cmpk_handle_interrupt_status() - * - * Overview: The function is responsible for extract the message from - * firmware. It will contain dedicated info in - * ws-07-0063-v06-rtl819x-command-packet-specification-070315.doc. - * Please refer to chapter "Interrupt Status Element". - * - * Input: struct net_device *dev, - * u8* pmsg - Message Pointer of the command packet. - * - * Output: NONE - * - * Return: NONE - * - * Revised History: - * When Who Remark - * 05/12/2008 amy Add this for rtl8192 porting from windows code. - * - *---------------------------------------------------------------------------*/ +/* + * The function is responsible for extract the message from + * firmware. It will contain dedicated info in + * ws-07-0063-v06-rtl819x-command-packet-specification-070315.doc. + * Please refer to chapter "Interrupt Status Element". + */ static void cmpk_handle_interrupt_status( struct net_device *dev, @@ -399,25 +341,12 @@ cmpk_handle_interrupt_status( } -/*----------------------------------------------------------------------------- - * Function: cmpk_handle_query_config_rx() - * - * Overview: The function is responsible for extract the message from - * firmware. It will contain dedicated info in - * ws-06-0063-rtl8190-command-packet-specification. Please - * refer to chapter "Beacon State Element". - * - * Input: u8 * pmsg - Message Pointer of the command packet. - * - * Output: NONE - * - * Return: NONE - * - * Revised History: - * When Who Remark - * 05/12/2008 amy Create Version 0 porting from windows code. - * - *---------------------------------------------------------------------------*/ +/* + * The function is responsible for extract the message from + * firmware. It will contain dedicated info in + * ws-06-0063-rtl8190-command-packet-specification. Please + * refer to chapter "Beacon State Element". + */ static void cmpk_handle_query_config_rx( struct net_device *dev, @@ -447,23 +376,10 @@ cmpk_handle_query_config_rx( } -/*----------------------------------------------------------------------------- - * Function: cmpk_count_tx_status() - * - * Overview: Count aggregated tx status from firmwar of one type rx command - * packet element id = RX_TX_STATUS. - * - * Input: NONE - * - * Output: NONE - * - * Return: NONE - * - * Revised History: - * When Who Remark - * 05/12/2008 amy Create Version 0 porting from windows code. - * - *---------------------------------------------------------------------------*/ +/* + * Count aggregated tx status from firmwar of one type rx command + * packet element id = RX_TX_STATUS. + */ static void cmpk_count_tx_status( struct net_device *dev, cmpk_tx_status_t *pstx_status) { @@ -514,23 +430,10 @@ static void cmpk_count_tx_status( struct net_device *dev, -/*----------------------------------------------------------------------------- - * Function: cmpk_handle_tx_status() - * - * Overview: Firmware add a new tx feedback status to reduce rx command - * packet buffer operation load. - * - * Input: NONE - * - * Output: NONE - * - * Return: NONE - * - * Revised History: - * When Who Remark - * 05/12/2008 amy Create Version 0 porting from windows code. - * - *---------------------------------------------------------------------------*/ +/* + * Firmware add a new tx feedback status to reduce rx command + * packet buffer operation load. + */ static void cmpk_handle_tx_status( struct net_device *dev, @@ -545,22 +448,7 @@ cmpk_handle_tx_status( } -/*----------------------------------------------------------------------------- - * Function: cmpk_handle_tx_rate_history() - * - * Overview: Firmware add a new tx rate history - * - * Input: NONE - * - * Output: NONE - * - * Return: NONE - * - * Revised History: - * When Who Remark - * 05/12/2008 amy Create Version 0 porting from windows code. - * - *---------------------------------------------------------------------------*/ +/* Firmware add a new tx rate history */ static void cmpk_handle_tx_rate_history( struct net_device *dev, @@ -625,26 +513,13 @@ cmpk_handle_tx_rate_history( } -/*----------------------------------------------------------------------------- - * Function: cmpk_message_handle_rx() - * - * Overview: In the function, we will capture different RX command packet - * info. Every RX command packet element has different message - * length and meaning in content. We only support three type of RX - * command packet now. Please refer to document - * ws-06-0063-rtl8190-command-packet-specification. - * - * Input: NONE - * - * Output: NONE - * - * Return: NONE - * - * Revised History: - * When Who Remark - * 05/06/2008 amy Create Version 0 porting from windows code. - * - *---------------------------------------------------------------------------*/ +/* + * In the function, we will capture different RX command packet + * info. Every RX command packet element has different message + * length and meaning in content. We only support three type of RX + * command packet now. Please refer to document + * ws-06-0063-rtl8190-command-packet-specification. + */ u32 cmpk_message_handle_rx(struct net_device *dev, struct ieee80211_rx_stats *pstats) { // u32 debug_level = DBG_LOUD; diff --git a/drivers/staging/rtl8192e/r819xE_firmware.c b/drivers/staging/rtl8192e/r819xE_firmware.c index b3ffafe..5c3da46 100644 --- a/drivers/staging/rtl8192e/r819xE_firmware.c +++ b/drivers/staging/rtl8192e/r819xE_firmware.c @@ -3,16 +3,7 @@ * * Description: This routine will initialize firmware. If any error occurs * during the initialization process, the routine shall terminate - * immediately and return fail. NIC driver should call - * NdisOpenFile only from MiniportInitialize. - * - * Arguments: The pointer of the adapter - * - * Returns: - * NDIS_STATUS_FAILURE - the following initialization process - * should be terminated - * NDIS_STATUS_SUCCESS - if firmware initialization process - * success + * immediately and return fail. */ #include "r8192E.h" @@ -116,18 +107,11 @@ static bool fw_download_code(struct net_device *dev, u8 *code_virtual_address, } /* - * Procedure: Check whether main code is download OK. If OK, turn on CPU - * - * Description: CPU register locates in different page against general - * register. Switch to CPU register in the begin and switch - * back before return - * - * Arguments: The pointer of the adapter + * Check whether main code is download OK. If OK, turn on CPU * - * Returns: - * NDIS_STATUS_FAILURE - the following initialization process should be - * terminated - * NDIS_STATUS_SUCCESS - if firmware initialization process success + * CPU register locates in different page against general + * register. Switch to CPU register in the begin and switch + * back before return */ static bool CPUcheck_maincodeok_turnonCPU(struct net_device *dev) { -- 2.7.4