···145145static void dm_send_rssi_tofw(struct net_device *dev);146146static void dm_ctstoself(struct net_device *dev);147147148148-//================================================================================149149-// HW Dynamic mechanism interface.150150-//================================================================================151151-152152-//153153-// Description:154154-// Prepare SW resource for HW dynamic mechanism.155155-//156156-// Assumption:157157-// This function is only invoked at driver intialization once.158158-//159159-//148148+/*149149+ * Prepare SW resource for HW dynamic mechanism.150150+ * This function is only invoked at driver intialization once.151151+ */160152void init_hal_dm(struct net_device *dev)161153{162154 struct r8192_priv *priv = ieee80211_priv(dev);···342350}343351344352345345-/*-----------------------------------------------------------------------------346346- * Function: dm_check_rate_adaptive()347347- *348348- * Overview:349349- *350350- * Input: NONE351351- *352352- * Output: NONE353353- *354354- * Return: NONE355355- *356356- * Revised History:357357- * When Who Remark358358- * 05/26/08 amy Create version 0 proting from windows code.359359- *360360- *---------------------------------------------------------------------------*/361353static void dm_check_rate_adaptive(struct net_device * dev)362354{363355 struct r8192_priv *priv = ieee80211_priv(dev);···18671891}1868189218691893#endif18701870-/*-----------------------------------------------------------------------------18711871- * Function: dm_change_dynamic_initgain_thresh()18721872- *18731873- * Overview:18741874- *18751875- * Input: NONE18761876- *18771877- * Output: NONE18781878- *18791879- * Return: NONE18801880- *18811881- * Revised History:18821882- * When Who Remark18831883- * 05/29/2008 amy Create Version 0 porting from windows code.18841884- *18851885- *---------------------------------------------------------------------------*/18941894+18861895void dm_change_dynamic_initgain_thresh(struct net_device *dev, u32 dm_type, u32 dm_value)18871896{18881897 if (dm_type == DIG_TYPE_THRESH_HIGH)···19371976}193819771939197819401940-/*-----------------------------------------------------------------------------19411941- * Function: dm_dig_init()19421942- *19431943- * Overview: Set DIG scheme init value.19441944- *19451945- * Input: NONE19461946- *19471947- * Output: NONE19481948- *19491949- * Return: NONE19501950- *19511951- * Revised History:19521952- * When Who Remark19531953- * 05/15/2008 amy Create Version 0 porting from windows code.19541954- *19551955- *---------------------------------------------------------------------------*/19791979+/* Set DIG scheme init value. */19561980static void dm_dig_init(struct net_device *dev)19571981{19581982 struct r8192_priv *priv = ieee80211_priv(dev);···19692023}197020241971202519721972-/*-----------------------------------------------------------------------------19731973- * Function: dm_ctrl_initgain_byrssi()19741974- *19751975- * Overview: Driver must monitor RSSI and notify firmware to change initial19761976- * gain according to different threshold. BB team provide the19771977- * suggested solution.19781978- *19791979- * Input: struct net_device *dev19801980- *19811981- * Output: NONE19821982- *19831983- * Return: NONE19841984- *19851985- * Revised History:19861986- * When Who Remark19871987- * 05/27/2008 amy Create Version 0 porting from windows code.19881988- *---------------------------------------------------------------------------*/20262026+/*20272027+ * Driver must monitor RSSI and notify firmware to change initial20282028+ * gain according to different threshold. BB team provide the20292029+ * suggested solution.20302030+ */19892031static void dm_ctrl_initgain_byrssi(struct net_device *dev)19902032{19912033···2199226522002266}2201226722022202-22032203-/*-----------------------------------------------------------------------------22042204- * Function: dm_ctrl_initgain_byrssi_highpwr()22052205- *22062206- * Overview:22072207- *22082208- * Input: NONE22092209- *22102210- * Output: NONE22112211- *22122212- * Return: NONE22132213- *22142214- * Revised History:22152215- * When Who Remark22162216- * 05/28/2008 amy Create Version 0 porting from windows code.22172217- *22182218- *---------------------------------------------------------------------------*/22192268static void dm_ctrl_initgain_byrssi_highpwr(22202269 struct net_device * dev)22212270{···27022785270327862704278727052705-/*-----------------------------------------------------------------------------27062706- * Function: dm_check_rfctrl_gpio()27072707- *27082708- * Overview: Copy 8187B template for 9xseries.27092709- *27102710- * Input: NONE27112711- *27122712- * Output: NONE27132713- *27142714- * Return: NONE27152715- *27162716- * Revised History:27172717- * When Who Remark27182718- * 05/28/2008 amy Create Version 0 porting from windows code.27192719- *27202720- *---------------------------------------------------------------------------*/27882788+/* Copy 8187B template for 9xseries */27212789#if 127222790static void dm_check_rfctrl_gpio(struct net_device * dev)27232791{···27282826}2729282727302828#endif27312731-/*-----------------------------------------------------------------------------27322732- * Function: dm_check_pbc_gpio()27332733- *27342734- * Overview: Check if PBC button is pressed.27352735- *27362736- * Input: NONE27372737- *27382738- * Output: NONE27392739- *27402740- * Return: NONE27412741- *27422742- * Revised History:27432743- * When Who Remark27442744- * 05/28/2008 amy Create Version 0 porting from windows code.27452745- *27462746- *---------------------------------------------------------------------------*/28292829+/* Check if PBC button is pressed. */27472830static void dm_check_pbc_gpio(struct net_device *dev)27482831{27492832#ifdef RTL8192U···2753286627542867#ifdef RTL8192E2755286827562756-/*-----------------------------------------------------------------------------27572757- * Function: dm_GPIOChangeRF27582758- * Overview: PCI will not support workitem call back HW radio on-off control.27592759- *27602760- * Input: NONE27612761- *27622762- * Output: NONE27632763- *27642764- * Return: NONE27652765- *27662766- * Revised History:27672767- * When Who Remark27682768- * 02/21/2008 MHC Create Version 0.27692769- *27702770- *---------------------------------------------------------------------------*/28692869+/* PCI will not support workitem call back HW radio on-off control. */27712870void dm_gpio_change_rf_callback(struct work_struct *work)27722871{27732872 struct delayed_work *dwork = container_of(work,struct delayed_work,work);27742774- struct r8192_priv *priv = container_of(dwork,struct r8192_priv,gpio_change_rf_wq);27752775- struct net_device *dev = priv->ieee80211->dev;28732873+ struct r8192_priv *priv = container_of(dwork,struct r8192_priv,gpio_change_rf_wq);28742874+ struct net_device *dev = priv->ieee80211->dev;27762875 u8 tmp1byte;27772876 RT_RF_POWER_STATE eRfPowerStateToSet;27782877 bool bActuallySet = false;···27942921}2795292227962923#endif27972797-/*-----------------------------------------------------------------------------27982798- * Function: DM_RFPathCheckWorkItemCallBack()27992799- *28002800- * Overview: Check if Current RF RX path is enabled28012801- *28022802- * Input: NONE28032803- *28042804- * Output: NONE28052805- *28062806- * Return: NONE28072807- *28082808- * Revised History:28092809- * When Who Remark28102810- * 01/30/2008 MHC Create Version 0.28112811- *28122812- *---------------------------------------------------------------------------*/29242924+29252925+/* Check if Current RF RX path is enabled */28132926void dm_rf_pathcheck_workitemcallback(struct work_struct *work)28142927{28152928 struct delayed_work *dwork = container_of(work,struct delayed_work,work);···31063247 }31073248}3108324931093109-/*-----------------------------------------------------------------------------31103110- * Function: dm_check_rx_path_selection()31113111- *31123112- * Overview: Call a workitem to check current RXRF path and Rx Path selection by RSSI.31133113- *31143114- * Input: NONE31153115- *31163116- * Output: NONE31173117- *31183118- * Return: NONE31193119- *31203120- * Revised History:31213121- * When Who Remark31223122- * 05/28/2008 amy Create Version 0 porting from windows code.31233123- *31243124- *---------------------------------------------------------------------------*/31253125-static void dm_check_rx_path_selection(struct net_device *dev)32503250+/*32513251+ * Call a workitem to check current RXRF path and Rx Path selection by RSSI.32523252+ */32533253+static void dm_check_rx_path_selection(struct net_device *dev)31263254{31273255 struct r8192_priv *priv = ieee80211_priv(dev);31283256 queue_delayed_work(priv->priv_wq,&priv->rfpath_check_wq,0);31293257}31303130-3131325831323259static void dm_init_fsync (struct net_device *dev)31333260{···35093664 }35103665}3511366635123512-/*---------------------------Define function prototype------------------------*/35133513-/*-----------------------------------------------------------------------------35143514- * Function: DM_DynamicTxPower()35153515- *35163516- * Overview: Detect Signal strength to control TX Registry35173517- Tx Power Control For Near/Far Range35183518- *35193519- * Input: NONE35203520- *35213521- * Output: NONE35223522- *35233523- * Return: NONE35243524- *35253525- * Revised History:35263526- * When Who Remark35273527- * 03/06/2008 Jacken Create Version 0.35283528- *35293529- *---------------------------------------------------------------------------*/36673667+/*36683668+ * Detect Signal strength to control TX Registry36693669+ * Tx Power Control For Near/Far Range36703670+ */35303671static void dm_init_dynamic_txpower(struct net_device *dev)35313672{35323673 struct r8192_priv *priv = ieee80211_priv(dev);
+44-169
drivers/staging/rtl8192e/r819xE_cmdpkt.c
···2525#include "r8192E_hw.h"2626#include "r819xE_cmdpkt.h"27272828-/*-----------------------------------------------------------------------------2929- * Function: cmpk_message_handle_tx()3030- *3131- * Overview: Driver internal module can call the API to send message to3232- * firmware side. For example, you can send a debug command packet.3333- * Or you can send a request for FW to modify RLX4181 LBUS HW bank.3434- * Otherwise, you can change MAC/PHT/RF register by firmware at3535- * run time. We do not support message more than one segment now.3636- *3737- * Input: NONE3838- *3939- * Output: NONE4040- *4141- * Return: NONE4242- *4343- * Revised History:4444- * When Who Remark4545- * 05/06/2008 amy porting from windows code.4646- *4747- *---------------------------------------------------------------------------*/2828+/*2929+ * Driver internal module can call the API to send message to3030+ * firmware side. For example, you can send a debug command packet.3131+ * Or you can send a request for FW to modify RLX4181 LBUS HW bank.3232+ * Otherwise, you can change MAC/PHT/RF register by firmware at3333+ * run time. We do not support message more than one segment now.3434+ */4835RT_STATUS cmpk_message_handle_tx(4936 struct net_device *dev,5037 u8* code_virtual_address,···131144#endif132145}133146134134-/*-----------------------------------------------------------------------------135135- * Function: cmpk_counttxstatistic()136136- *137137- * Overview:138138- *139139- * Input: PADAPTER pAdapter - .140140- * CMPK_TXFB_T *psTx_FB - .141141- *142142- * Output: NONE143143- *144144- * Return: NONE145145- *146146- * Revised History:147147- * When Who Remark148148- * 05/12/2008 amy Create Version 0 porting from windows code.149149- *150150- *---------------------------------------------------------------------------*/151151-static void147147+static void152148cmpk_count_txstatistic(153149 struct net_device *dev,154150 cmpk_txfb_t *pstx_fb)···210240211241212242213213-/*-----------------------------------------------------------------------------214214- * Function: cmpk_handle_tx_feedback()215215- *216216- * Overview: The function is responsible for extract the message inside TX217217- * feedbck message from firmware. It will contain dedicated info in218218- * ws-06-0063-rtl8190-command-packet-specification. Please219219- * refer to chapter "TX Feedback Element". We have to read 20 bytes220220- * in the command packet.221221- *222222- * Input: struct net_device * dev223223- * u8 * pmsg - Msg Ptr of the command packet.224224- *225225- * Output: NONE226226- *227227- * Return: NONE228228- *229229- * Revised History:230230- * When Who Remark231231- * 05/08/2008 amy Create Version 0 porting from windows code.232232- *233233- *---------------------------------------------------------------------------*/234234-static void243243+/*244244+ * The function is responsible for extract the message inside TX245245+ * feedbck message from firmware. It will contain dedicated info in246246+ * ws-06-0063-rtl8190-command-packet-specification. Please247247+ * refer to chapter "TX Feedback Element". We have to read 20 bytes248248+ * in the command packet.249249+ */250250+static void235251cmpk_handle_tx_feedback(236252 struct net_device *dev,237253 u8 * pmsg)···279323}280324281325282282-/*-----------------------------------------------------------------------------283283- * Function: cmpk_handle_interrupt_status()284284- *285285- * Overview: The function is responsible for extract the message from286286- * firmware. It will contain dedicated info in287287- * ws-07-0063-v06-rtl819x-command-packet-specification-070315.doc.288288- * Please refer to chapter "Interrupt Status Element".289289- *290290- * Input: struct net_device *dev,291291- * u8* pmsg - Message Pointer of the command packet.292292- *293293- * Output: NONE294294- *295295- * Return: NONE296296- *297297- * Revised History:298298- * When Who Remark299299- * 05/12/2008 amy Add this for rtl8192 porting from windows code.300300- *301301- *---------------------------------------------------------------------------*/326326+/*327327+ * The function is responsible for extract the message from328328+ * firmware. It will contain dedicated info in329329+ * ws-07-0063-v06-rtl819x-command-packet-specification-070315.doc.330330+ * Please refer to chapter "Interrupt Status Element".331331+ */302332static void303333cmpk_handle_interrupt_status(304334 struct net_device *dev,···341399}342400343401344344-/*-----------------------------------------------------------------------------345345- * Function: cmpk_handle_query_config_rx()346346- *347347- * Overview: The function is responsible for extract the message from348348- * firmware. It will contain dedicated info in349349- * ws-06-0063-rtl8190-command-packet-specification. Please350350- * refer to chapter "Beacon State Element".351351- *352352- * Input: u8 * pmsg - Message Pointer of the command packet.353353- *354354- * Output: NONE355355- *356356- * Return: NONE357357- *358358- * Revised History:359359- * When Who Remark360360- * 05/12/2008 amy Create Version 0 porting from windows code.361361- *362362- *---------------------------------------------------------------------------*/402402+/*403403+ * The function is responsible for extract the message from404404+ * firmware. It will contain dedicated info in405405+ * ws-06-0063-rtl8190-command-packet-specification. Please406406+ * refer to chapter "Beacon State Element".407407+ */363408static void364409cmpk_handle_query_config_rx(365410 struct net_device *dev,···376447}377448378449379379-/*-----------------------------------------------------------------------------380380- * Function: cmpk_count_tx_status()381381- *382382- * Overview: Count aggregated tx status from firmwar of one type rx command383383- * packet element id = RX_TX_STATUS.384384- *385385- * Input: NONE386386- *387387- * Output: NONE388388- *389389- * Return: NONE390390- *391391- * Revised History:392392- * When Who Remark393393- * 05/12/2008 amy Create Version 0 porting from windows code.394394- *395395- *---------------------------------------------------------------------------*/450450+/*451451+ * Count aggregated tx status from firmwar of one type rx command452452+ * packet element id = RX_TX_STATUS.453453+ */396454static void cmpk_count_tx_status( struct net_device *dev,397455 cmpk_tx_status_t *pstx_status)398456{···430514431515432516433433-/*-----------------------------------------------------------------------------434434- * Function: cmpk_handle_tx_status()435435- *436436- * Overview: Firmware add a new tx feedback status to reduce rx command437437- * packet buffer operation load.438438- *439439- * Input: NONE440440- *441441- * Output: NONE442442- *443443- * Return: NONE444444- *445445- * Revised History:446446- * When Who Remark447447- * 05/12/2008 amy Create Version 0 porting from windows code.448448- *449449- *---------------------------------------------------------------------------*/517517+/*518518+ * Firmware add a new tx feedback status to reduce rx command519519+ * packet buffer operation load.520520+ */450521static void451522cmpk_handle_tx_status(452523 struct net_device *dev,···448545}449546450547451451-/*-----------------------------------------------------------------------------452452- * Function: cmpk_handle_tx_rate_history()453453- *454454- * Overview: Firmware add a new tx rate history455455- *456456- * Input: NONE457457- *458458- * Output: NONE459459- *460460- * Return: NONE461461- *462462- * Revised History:463463- * When Who Remark464464- * 05/12/2008 amy Create Version 0 porting from windows code.465465- *466466- *---------------------------------------------------------------------------*/548548+/* Firmware add a new tx rate history */467549static void468550cmpk_handle_tx_rate_history(469551 struct net_device *dev,···513625}514626515627516516-/*-----------------------------------------------------------------------------517517- * Function: cmpk_message_handle_rx()518518- *519519- * Overview: In the function, we will capture different RX command packet520520- * info. Every RX command packet element has different message521521- * length and meaning in content. We only support three type of RX522522- * command packet now. Please refer to document523523- * ws-06-0063-rtl8190-command-packet-specification.524524- *525525- * Input: NONE526526- *527527- * Output: NONE528528- *529529- * Return: NONE530530- *531531- * Revised History:532532- * When Who Remark533533- * 05/06/2008 amy Create Version 0 porting from windows code.534534- *535535- *---------------------------------------------------------------------------*/628628+/*629629+ * In the function, we will capture different RX command packet630630+ * info. Every RX command packet element has different message631631+ * length and meaning in content. We only support three type of RX632632+ * command packet now. Please refer to document633633+ * ws-06-0063-rtl8190-command-packet-specification.634634+ */536635u32 cmpk_message_handle_rx(struct net_device *dev, struct ieee80211_rx_stats *pstats)537636{538637// u32 debug_level = DBG_LOUD;
+5-21
drivers/staging/rtl8192e/r819xE_firmware.c
···33 *44 * Description: This routine will initialize firmware. If any error occurs55 * during the initialization process, the routine shall terminate66- * immediately and return fail. NIC driver should call77- * NdisOpenFile only from MiniportInitialize.88- *99- * Arguments: The pointer of the adapter1010- *1111- * Returns:1212- * NDIS_STATUS_FAILURE - the following initialization process1313- * should be terminated1414- * NDIS_STATUS_SUCCESS - if firmware initialization process1515- * success66+ * immediately and return fail.167 */178189#include "r8192E.h"···107116}108117109118/*110110- * Procedure: Check whether main code is download OK. If OK, turn on CPU119119+ * Check whether main code is download OK. If OK, turn on CPU111120 *112112- * Description: CPU register locates in different page against general113113- * register. Switch to CPU register in the begin and switch114114- * back before return115115- *116116- * Arguments: The pointer of the adapter117117- *118118- * Returns:119119- * NDIS_STATUS_FAILURE - the following initialization process should be120120- * terminated121121- * NDIS_STATUS_SUCCESS - if firmware initialization process success121121+ * CPU register locates in different page against general122122+ * register. Switch to CPU register in the begin and switch123123+ * back before return122124 */123125static bool CPUcheck_maincodeok_turnonCPU(struct net_device *dev)124126{