#include "r819xU_phyreg.h"
#include "r819xU_cmdpkt.h"
#include "r8192U_dm.h"
-//#include "r8192xU_phyreg.h"
#include <linux/usb.h>
#include <linux/slab.h>
#include <linux/proc_fs.h>
#include "dot11d.h"
//set here to open your trace code. //WB
u32 rt_global_debug_component = \
- // COMP_INIT |
-// COMP_DBG |
- // COMP_EPROM |
-// COMP_PHY |
- // COMP_RF |
-// COMP_FIRMWARE |
-// COMP_CH |
- // COMP_POWER_TRACKING |
-// COMP_RATE |
- // COMP_TXAGC |
- // COMP_TRACE |
COMP_DOWN |
- // COMP_RECV |
- // COMP_SWBW |
COMP_SEC |
- // COMP_RESET |
- // COMP_SEND |
- // COMP_EVENTS |
COMP_ERR; //always open err flags on
#define TOTAL_CAM_ENTRY 32
module_param(ifname, charp, S_IRUGO|S_IWUSR);
-//module_param(hwseqnum,int, S_IRUGO|S_IWUSR);
module_param(hwwep, int, S_IRUGO|S_IWUSR);
module_param(channels, int, S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(ifname, " Net interface name, wlan%d=default");
-//MODULE_PARM_DESC(hwseqnum," Try to use hardware 802.11 header sequence numbers. Zero=default");
MODULE_PARM_DESC(hwwep, " Try to use hardware security support. ");
MODULE_PARM_DESC(channels, " Channel bitmask for specific locales. NYI");
//2004/02/11 In static WEP, OID_ADD_KEY or OID_ADD_WEP are set before STA associate to AP.
// However, ResetKey is called on OID_802_11_INFRASTRUCTURE_MODE and MlmeAssociateRequest
// In this condition, Cam can not be reset because upper layer will not set this static key again.
- //if(Adapter->EncAlgorithm == WEP_Encryption)
- // return;
-//debug
- //DbgPrint("========================================\n");
- //DbgPrint(" Call ResetAllEntry \n");
- //DbgPrint("========================================\n\n");
ulcommand |= BIT31|BIT30;
write_nic_dword(dev, RWCAM, ulcommand);
{
u32 data;
int status;
- /* int result; */
struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
struct usb_device *udev = priv->udev;
RTL8187_REQ_GET_REGS, RTL8187_REQT_READ,
(indx&0xff)|0xff00, (indx>>8)&0x0f,
&data, 4, HZ / 2);
- /* if(0 != result) {
- * printk(KERN_WARNING "read size of data = %d\, date = %d\n",
- * result, data);
- * }
- */
if (status < 0)
netdev_err(dev, "read_nic_dword TimeOut! status:%d\n", status);
static struct net_device_stats *rtl8192_stats(struct net_device *dev);
void rtl8192_commit(struct net_device *dev);
-/* void rtl8192_restart(struct net_device *dev); */
void rtl8192_restart(struct work_struct *work);
-/* void rtl8192_rq_tx_ack(struct work_struct *work); */
void watch_dog_timer_callback(unsigned long data);
/****************************************************************************
seq_puts(m, "\n####################page 0##################\n ");
for (n = 0; n <= max;) {
- //printk( "\nD: %2x> ", n);
seq_printf(m, "\nD: %2x > ", n);
for (i = 0; i < 16 && n <= max; i++, n++)
seq_printf(m, "%2x ", read_nic_byte(dev, 0x000|n));
-
- // printk("%2x ",read_nic_byte(dev,n));
}
seq_puts(m, "\n####################page 1##################\n ");
for (n = 0; n <= max;) {
- //printk( "\nD: %2x> ", n);
seq_printf(m, "\nD: %2x > ", n);
for (i = 0; i < 16 && n <= max; i++, n++)
seq_printf(m, "%2x ", read_nic_byte(dev, 0x100|n));
-
- // printk("%2x ",read_nic_byte(dev,n));
}
seq_puts(m, "\n####################page 3##################\n ");
for (n = 0; n <= max;) {
- //printk( "\nD: %2x> ", n);
seq_printf(m, "\nD: %2x > ", n);
for (i = 0; i < 16 && n <= max; i++, n++)
seq_printf(m, "%2x ", read_nic_byte(dev, 0x300|n));
-
- // printk("%2x ",read_nic_byte(dev,n));
}
seq_putc(m, '\n');
"TX MANAGE priority error int: %lu\n"
"TX BEACON priority ok int: %lu\n"
"TX BEACON priority error int: %lu\n"
-// "TX high priority ok int: %lu\n"
-// "TX high priority failed error int: %lu\n"
"TX queue resume: %lu\n"
"TX queue stopped?: %d\n"
"TX fifo overflow: %lu\n"
-// "TX beacon: %lu\n"
"TX VI queue: %d\n"
"TX VO queue: %d\n"
"TX BE queue: %d\n"
"TX BK queue: %d\n"
-// "TX HW queue: %d\n"
"TX VI dropped: %lu\n"
"TX VO dropped: %lu\n"
"TX BE dropped: %lu\n"
"TX BK dropped: %lu\n"
"TX total data packets %lu\n",
-// "TX beacon aborted: %lu\n",
priv->stats.txviokint,
priv->stats.txvierr,
priv->stats.txvookint,
priv->stats.txmanageerr,
priv->stats.txbeaconokint,
priv->stats.txbeaconerr,
-// priv->stats.txhpokint,
-// priv->stats.txhperr,
priv->stats.txresumed,
netif_queue_stopped(dev),
priv->stats.txoverflow,
-// priv->stats.txbeacon,
atomic_read(&(priv->tx_pending[VI_PRIORITY])),
atomic_read(&(priv->tx_pending[VO_PRIORITY])),
atomic_read(&(priv->tx_pending[BE_PRIORITY])),
atomic_read(&(priv->tx_pending[BK_PRIORITY])),
-// read_nic_byte(dev, TXFIFOCOUNT),
priv->stats.txvidrop,
priv->stats.txvodrop,
priv->stats.txbedrop,
priv->stats.txbkdrop,
priv->stats.txdatapkt
-// priv->stats.txbeaconerr
);
return 0;
-----------------------------MISC STUFF-------------------------
*****************************************************************************/
-/* this is only for debugging */
-void print_buffer(u32 *buffer, int len)
-{
- int i;
- u8 *buf = (u8 *)buffer;
-
- printk("ASCII BUFFER DUMP (len: %x):\n", len);
-
- for (i = 0; i < len; i++)
- printk("%c", buf[i]);
-
- printk("\nBINARY BUFFER DUMP (len: %x):\n", len);
-
- for (i = 0; i < len; i++)
- printk("%x", buf[i]);
-
- printk("\n");
-}
-
-//short check_nic_enough_desc(struct net_device *dev, priority_t priority)
short check_nic_enough_desc(struct net_device *dev, int queue_index)
{
struct r8192_priv *priv = ieee80211_priv(dev);
void tx_timeout(struct net_device *dev)
{
struct r8192_priv *priv = ieee80211_priv(dev);
- //rtl8192_commit(dev);
schedule_work(&priv->reset_wq);
- //DMESG("TXTIMEOUT");
}
RT_TRACE(COMP_EPROM, "EEPROM addr %x : %x", i, eprom_read(dev, i));
}
-/* this is only for debug */
-void rtl8192_dump_reg(struct net_device *dev)
-{
- int i;
- int n;
- int max = 0x1ff;
-
- RT_TRACE(COMP_PHY, "Dumping NIC register map");
-
- for (n = 0; n <= max;)
- {
- printk("\nD: %2x> ", n);
- for (i = 0; i < 16 && n <= max; i++, n++)
- printk("%2x ", read_nic_byte(dev, n));
- }
- printk("\n");
-}
/****************************************************************************
------------------------------HW STUFF---------------------------
void rtl8192_set_chan(struct net_device *dev, short ch)
{
struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
-// u32 tx;
RT_TRACE(COMP_CH, "=====>%s()====ch:%d\n", __func__, ch);
priv->chan = ch;
/* this hack should avoid frame TX during channel setting*/
-
-// tx = read_nic_dword(dev,TX_CONF);
-// tx &= ~TX_LOOPBACK_MASK;
-
#ifndef LOOP_TEST
-// write_nic_dword(dev,TX_CONF, tx |( TX_LOOPBACK_MAC<<TX_LOOPBACK_SHIFT));
-
//need to implement rf set channel here WB
if (priv->rf_set_chan)
priv->rf_set_chan(dev, priv->chan);
mdelay(10);
-// write_nic_dword(dev,TX_CONF,tx | (TX_LOOPBACK_NONE<<TX_LOOPBACK_SHIFT));
#endif
}
static void rtl8192_rx_isr(struct urb *urb);
-//static void rtl8192_rx_isr(struct urb *rx_urb);
u32 get_rxpacket_shiftbytes_819xusb(struct ieee80211_rx_stats *pstats)
{
kfree_skb(skb);
break;
}
-// printk("nomal packet IN request!\n");
usb_fill_bulk_urb(entry, priv->udev,
usb_rcvbulkpipe(priv->udev, 3), skb_tail_pointer(skb),
RX_URB_SIZE, rtl8192_rx_isr, skb);
/* command packet rx procedure */
while (skb_queue_len(&priv->rx_queue) < MAX_RX_URB + 3) {
-// printk("command packet IN request!\n");
skb = __dev_alloc_skb(RX_URB_SIZE, GFP_KERNEL);
if (!skb)
break;
rxconf = rxconf | RCR_ADF;
rxconf = rxconf | RCR_AB;
rxconf = rxconf | RCR_AM;
- //rxconf = rxconf | RCR_ACF;
if (dev->flags & IFF_PROMISC) {DMESG("NIC in promisc mode"); }
if (priv->ieee80211->iw_mode == IW_MODE_MONITOR || \
dev->flags & IFF_PROMISC){
rxconf = rxconf | RCR_AAP;
- } /*else if(priv->ieee80211->iw_mode == IW_MODE_MASTER){
- rxconf = rxconf | (1<<ACCEPT_ALLMAC_FRAME_SHIFT);
- rxconf = rxconf | (1<<RX_CHECK_BSSID_SHIFT);
- }*/else{
+ } else{
rxconf = rxconf | RCR_APM;
rxconf = rxconf | RCR_CBSSID;
}
rxconf = rxconf & ~MAX_RX_DMA_MASK;
rxconf = rxconf | ((u32)7<<RCR_MXDMA_OFFSET);
-// rxconf = rxconf | (1<<RX_AUTORESETPHY_SHIFT);
rxconf = rxconf | RCR_ONLYERLPKT;
-// rxconf = rxconf &~ RCR_CS_MASK;
-// rxconf = rxconf | (1<<RCR_CS_SHIFT);
-
write_nic_dword(dev, RCR, rxconf);
#ifdef DEBUG_RX
//wait to be removed
void rtl8192_rx_enable(struct net_device *dev)
{
- //u8 cmd;
-
- //struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
-
rtl8192_rx_initiate(dev);
-
-// rtl8192_set_rxconf(dev);
}
priv->stats.rxstaterr++;
priv->ieee80211->stats.rx_errors++;
usb_free_urb(urb);
- // printk("%s():rx status err\n",__FUNCTION__);
return;
}
skb_unlink(skb, &priv->rx_queue);
{
u32 status;
- //RT_TRACE(COMP_RECV, DBG_TRACE, ("---> RxCommandPacketHandle819xUsb()\n"));
-
status = cmpk_message_handle_rx(dev, pstats);
if (status)
{
DMESG("rxcommandpackethandle819xusb: It is a command packet\n");
}
- else
- {
- //RT_TRACE(COMP_RECV, DBG_TRACE, ("RxCommandPacketHandle819xUsb: It is not a command packet\n"));
- }
- //RT_TRACE(COMP_RECV, DBG_TRACE, ("<--- RxCommandPacketHandle819xUsb()\n"));
return status;
}
spin_lock_irqsave(&priv->tx_lock, flags);
memcpy((unsigned char *)(skb->cb), &dev, sizeof(dev));
-// tcb_desc->RATRIndex = 7;
-// tcb_desc->bTxDisableRateFallBack = 1;
-// tcb_desc->bTxUseDriverAssingedRate = 1;
tcb_desc->bTxEnableFwCalcDur = 1;
skb_push(skb, priv->ieee80211->tx_headroom);
ret = rtl8192_tx(dev, skb);
- //priv->ieee80211->stats.tx_bytes+=(skb->len - priv->ieee80211->tx_headroom);
- //priv->ieee80211->stats.tx_packets++;
-
spin_unlock_irqrestore(&priv->tx_lock, flags);
-// return ret;
return;
}
memset(agg_skb->data, 0, agg_skb->len);
skb_reserve(agg_skb, ieee->tx_headroom);
-// RT_DEBUG_DATA(COMP_SEND, skb->cb, sizeof(skb->cb));
/* reserve info for first subframe Tx descriptor to be set in the tx function */
skb = pSendList->tx_agg_frames[0];
tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
tcb_desc->pkt_size = skb->len;
tcb_desc->DrvAggrNum = pSendList->nr_drv_agg_frames;
netdev_dbg(dev, "DrvAggNum = %d\n", tcb_desc->DrvAggrNum);
-// RT_DEBUG_DATA(COMP_SEND, skb->cb, sizeof(skb->cb));
-// printk("========>skb->data ======> \n");
-// RT_DEBUG_DATA(COMP_SEND, skb->data, skb->len);
memcpy(agg_skb->cb, skb->cb, sizeof(skb->cb));
memcpy(skb_put(agg_skb, skb->len), skb->data, skb->len);
/* Fill Tx descriptor */
memset(tx_agg_desc, 0, sizeof(tx_desc_819x_usb_aggr_subframe));
/* DWORD 0 */
- //tx_agg_desc->LINIP = 0;
- //tx_agg_desc->CmdInit = 1;
tx_agg_desc->Offset = sizeof(tx_fwinfo_819x_usb) + 8;
/* already raw data, need not to subtract header length */
tx_agg_desc->PktSize = skb->len & 0xffff;
tx_agg_desc->SecCAMID = 0;
tx_agg_desc->RATid = tcb_desc->RATRIndex;
{
- //MPDUOverhead = 0;
tx_agg_desc->NoEnc = 1;
}
tx_agg_desc->SecType = 0x0;
//DWORD 2
/* According windows driver, it seems that there no need to fill this field */
- //tx_agg_desc->TxBufferSize= (u32)(skb->len - USB_HWDESC_HEADER_LEN);
/* to fill next packet */
skb_put(agg_skb, TX_PACKET_DRVAGGR_SUBFRAME_SHIFT_BYTES);
struct r8192_priv *priv = NULL;
cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
u8 queue_index = tcb_desc->queue_index;
-// bool bToSend0Byte;
-// u16 BufLen = skb->len;
memcpy(&dev, (struct net_device *)(skb->cb), sizeof(struct net_device *));
priv = ieee80211_priv(dev);
if (tcb_desc->queue_index != TXCMD_QUEUE) {
if (tx_urb->status == 0) {
dev->trans_start = jiffies;
- // Act as station mode, destination shall be unicast address.
- //priv->ieee80211->stats.tx_bytes+=(skb->len - priv->ieee80211->tx_headroom);
- //priv->ieee80211->stats.tx_packets++;
priv->stats.txoktotal++;
priv->ieee80211->LinkDetectInfo.NumTxOkInPeriod++;
priv->stats.txbytesunicast += (skb->len - priv->ieee80211->tx_headroom);
} else {
priv->ieee80211->stats.tx_errors++;
- //priv->stats.txmanageerr++;
/* TODO */
}
}
{
/*TODO*/
- /*
- u8* pHeader = skb->data;
-
- if(IsMgntQosData(pHeader) ||
- IsMgntQData_Ack(pHeader) ||
- IsMgntQData_Poll(pHeader) ||
- IsMgntQData_Poll_Ack(pHeader)
- )
- */
{
struct ieee80211_drv_agg_txb SendList;
write_nic_dword(dev, BSSIDR, ((u32 *)net->bssid)[0]);
write_nic_word(dev, BSSIDR+4, ((u16 *)net->bssid)[2]);
- //for(i=0;i<ETH_ALEN;i++)
- // write_nic_byte(dev,BSSID+i,net->bssid[i]);
rtl8192_update_msr(dev);
-// rtl8192_update_cap(dev, net->capability);
if (priv->ieee80211->iw_mode == IW_MODE_ADHOC)
{
write_nic_word(dev, ATIMWND, 2);
write_nic_word(dev, BCN_DMATIME, 1023);
write_nic_word(dev, BCN_INTERVAL, net->beacon_interval);
-// write_nic_word(dev, BcnIntTime, 100);
write_nic_word(dev, BCN_DRV_EARLY_INT, 1);
write_nic_byte(dev, BCN_ERR_THRESH, 100);
BcnTimeCfg |= (BcnCW<<BCN_TCFG_CW_SHIFT);
short rtl819xU_tx_cmd(struct net_device *dev, struct sk_buff *skb)
{
struct r8192_priv *priv = ieee80211_priv(dev);
- //u8 *tx;
int status;
struct urb *tx_urb;
- //int urb_buf_len;
unsigned int idx_pipe;
tx_desc_cmd_819x_usb *pdesc = (tx_desc_cmd_819x_usb *)skb->data;
cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
u8 queue_index = tcb_desc->queue_index;
- //printk("\n %s::queue_index = %d\n",__FUNCTION__, queue_index);
atomic_inc(&priv->tx_pending[queue_index]);
tx_urb = usb_alloc_urb(0, GFP_ATOMIC);
if (!tx_urb){
switch (QueueID) {
case BE_QUEUE:
- QueueSelect = QSLT_BE; //or QSelect = pTcb->priority;
+ QueueSelect = QSLT_BE;
break;
case BK_QUEUE:
- QueueSelect = QSLT_BK; //or QSelect = pTcb->priority;
+ QueueSelect = QSLT_BK;
break;
case VO_QUEUE:
- QueueSelect = QSLT_VO; //or QSelect = pTcb->priority;
+ QueueSelect = QSLT_VO;
break;
case VI_QUEUE:
- QueueSelect = QSLT_VI; //or QSelect = pTcb->priority;
+ QueueSelect = QSLT_VI;
break;
case MGNT_QUEUE:
QueueSelect = QSLT_MGNT;
// TODO: 2006.10.30 mark other queue selection until we verify it is OK
// TODO: Remove Assertions
-//#if (RTL819X_FPGA_VER & RTL819X_FPGA_GUANGAN_070502)
case TXCMD_QUEUE:
QueueSelect = QSLT_CMD;
break;
-//#endif
case HIGH_QUEUE:
QueueSelect = QSLT_HIGH;
break;
int pend;
int status;
struct urb *tx_urb = NULL, *tx_urb_zero = NULL;
- //int urb_len;
unsigned int idx_pipe;
-// RT_DEBUG_DATA(COMP_SEND, tcb_desc, sizeof(cb_desc));
-// printk("=============> %s\n", __FUNCTION__);
pend = atomic_read(&priv->tx_pending[tcb_desc->queue_index]);
/* we are locked here so the two atomic_read and inc are executed
* without interleaves
tx_desc->SecCAMID = 0;
tx_desc->RATid = tcb_desc->RATRIndex;
{
- //MPDUOverhead = 0;
tx_desc->NoEnc = 1;
}
tx_desc->SecType = 0x0;
idx_pipe = 0x5;
#endif
- //RT_DEBUG_DATA(COMP_SEND,tx_fwinfo,sizeof(tx_fwinfo_819x_usb));
- //RT_DEBUG_DATA(COMP_SEND,tx_desc,sizeof(tx_desc_819x_usb));
-
/* To submit bulk urb */
usb_fill_bulk_urb(tx_urb, udev,
usb_sndbulkpipe(udev, idx_pipe), skb->data,
extern void rtl8192_update_ratr_table(struct net_device *dev);
void rtl8192_link_change(struct net_device *dev)
{
-// int i;
-
struct r8192_priv *priv = ieee80211_priv(dev);
struct ieee80211_device *ieee = priv->ieee80211;
- //write_nic_word(dev, BCN_INTR_ITV, net->beacon_interval);
if (ieee->state == IEEE80211_LINKED)
{
rtl8192_net_update(dev);
EnableHWSecurityConfig8192(dev);
}
/*update timing params*/
-// RT_TRACE(COMP_CH, "========>%s(), chan:%d\n", __FUNCTION__, priv->chan);
-// rtl8192_set_chan(dev, priv->chan);
if (ieee->iw_mode == IW_MODE_INFRA || ieee->iw_mode == IW_MODE_ADHOC)
{
u32 reg = 0;
priv->ReceiveConfig = reg &= ~RCR_CBSSID;
write_nic_dword(dev, RCR, reg);
}
-
-// rtl8192_set_rxconf(dev);
}
static struct ieee80211_qos_parameters def_qos_parameters = {
struct net_device *dev = priv->ieee80211->dev;
struct ieee80211_qos_parameters *qos_parameters = &priv->ieee80211->current_network.qos_data.parameters;
u8 mode = priv->ieee80211->current_network.mode;
- //u32 size = sizeof(struct ieee80211_qos_parameters);
u8 u1bAIFS;
u32 u4bAcParam;
int i;
((u32)u1bAIFS << AC_PARAM_AIFS_OFFSET));
write_nic_dword(dev, WDCAPARA_ADD[i], u4bAcParam);
- //write_nic_dword(dev, WDCAPARA_ADD[i], 0x005e4332);
}
success:
void rtl8192_update_ratr_table(struct net_device *dev)
- // POCTET_STRING posLegacyRate,
- // u8* pMcsRate)
- // PRT_WLAN_STA pEntry)
{
struct r8192_priv *priv = ieee80211_priv(dev);
struct ieee80211_device *ieee = priv->ieee80211;
u8 *pMcsRate = ieee->dot11HTOperationalRateSet;
- //struct ieee80211_network *net = &ieee->current_network;
u32 ratr_value = 0;
u8 rate_index = 0;
rtl8192_config_rate(dev, (u16 *)(&ratr_value));
ratr_value |= (*(u16 *)(pMcsRate)) << 12;
-// switch (net->mode)
switch (ieee->mode)
{
case IEEE_A:
if (encrypt && (wpa_ie_len == 0)) {
/* wep encryption, no N mode setting */
return false;
-// } else if((wpa_ie_len != 0)&&(memcmp(&(ieee->wpa_ie[14]),ccmp_ie,4))) {
} else if ((wpa_ie_len != 0)) {
/* parse pairwise key type */
- //if((pairwisekey = WEP40)||(pairwisekey = WEP104)||(pairwisekey = TKIP))
if (((ieee->wpa_ie[0] == 0xdd) && (!memcmp(&(ieee->wpa_ie[14]), ccmp_ie, 4))) || ((ieee->wpa_ie[0] == 0x30) && (!memcmp(&ieee->wpa_ie[10], ccmp_rsn_ie, 4))))
return true;
else
if (ieee->mode == WIRELESS_MODE_N_24G || ieee->mode == WIRELESS_MODE_N_5G)
{
memcpy(ieee->Regdot11HTOperationalRateSet, ieee->RegHTSuppRateSet, 16);
- //RT_DEBUG_DATA(COMP_INIT, ieee->RegHTSuppRateSet, 16);
- //RT_DEBUG_DATA(COMP_INIT, ieee->Regdot11HTOperationalRateSet, 16);
}
else
memset(ieee->Regdot11HTOperationalRateSet, 0, 16);
priv->ieee80211->softmac_features = IEEE_SOFTMAC_SCAN |
IEEE_SOFTMAC_ASSOCIATE | IEEE_SOFTMAC_PROBERQ |
IEEE_SOFTMAC_PROBERS | IEEE_SOFTMAC_TX_QUEUE |
- IEEE_SOFTMAC_BEACONS;//added by amy 080604 //| //IEEE_SOFTMAC_SINGLE_QUEUE;
+ IEEE_SOFTMAC_BEACONS;//added by amy 080604
priv->ieee80211->active_scan = 1;
priv->ieee80211->modulation = IEEE80211_CCK_MODULATION | IEEE80211_OFDM_MODULATION;
priv->ieee80211->host_encrypt = 1;
priv->ieee80211->host_decrypt = 1;
- priv->ieee80211->start_send_beacons = NULL;//rtl819xusb_beacon_tx;//-by amy 080604
- priv->ieee80211->stop_send_beacons = NULL;//rtl8192_beacon_stop;//-by amy 080604
+ priv->ieee80211->start_send_beacons = NULL; //-by amy 080604
+ priv->ieee80211->stop_send_beacons = NULL; //-by amy 080604
priv->ieee80211->softmac_hard_start_xmit = rtl8192_hard_start_xmit;
priv->ieee80211->set_chan = rtl8192_set_chan;
priv->ieee80211->link_change = rtl8192_link_change;
priv->ieee80211->qos_support = 1;
//added by WB
-// priv->ieee80211->SwChnlByTimerHandler = rtl8192_phy_SwChnl;
priv->ieee80211->SetBWModeHandler = rtl8192_SetBWMode;
priv->ieee80211->handle_assoc_response = rtl8192_handle_assoc_response;
priv->ieee80211->handle_beacon = rtl8192_handle_beacon;
priv->EarlyRxThreshold = 7;
priv->enable_gpio0 = 0;
priv->TransmitConfig =
- // TCR_DurProcMode | //for RTL8185B, duration setting by HW
- //? TCR_DISReqQsize |
(TCR_MXDMA_2048<<TCR_MXDMA_OFFSET)| // Max DMA Burst Size per Tx DMA Burst, 7: reserved.
(priv->ShortRetryLimit<<TCR_SRL_OFFSET)| // Short retry limit
(priv->LongRetryLimit<<TCR_LRL_OFFSET) | // Long retry limit
#ifdef TO_DO_LIST
if (Adapter->bInHctTest)
pHalData->ReceiveConfig = pHalData->CSMethod |
- RCR_AMF | RCR_ADF | //RCR_AAP | //accept management/data
+ RCR_AMF | RCR_ADF | //accept management/data
//guangan200710
RCR_ACF | //accept control frame for SW AP needs PS-poll, 2005.07.07, by rcnjko.
RCR_AB | RCR_AM | RCR_APM | //accept BC/MC/UC
RCR_AMF | RCR_ADF | //accept management/data
RCR_ACF | //accept control frame for SW AP needs PS-poll, 2005.07.07, by rcnjko.
RCR_AB | RCR_AM | RCR_APM | //accept BC/MC/UC
- //RCR_AICV | RCR_ACRC32 | //accept ICV/CRC error packet
((u32)7<<RCR_MXDMA_OFFSET)| // Max DMA Burst Size per Rx DMA Burst, 7: unlimited.
(priv->EarlyRxThreshold<<RX_FIFO_THRESHOLD_SHIFT) | // Rx FIFO Threshold, 7: No Rx threshold.
(priv->EarlyRxThreshold == 7 ? RCR_ONLYERLPKT:0);
{
spin_lock_init(&priv->tx_lock);
spin_lock_init(&priv->irq_lock);//added by thomas
- //spin_lock_init(&priv->rf_lock);
sema_init(&priv->wx_sem, 1);
sema_init(&priv->rf_sem, 1);
mutex_init(&priv->mutex);
INIT_WORK(&priv->reset_wq, rtl8192_restart);
- //INIT_DELAYED_WORK(&priv->watch_dog_wq, hal_dm_watchdog);
INIT_DELAYED_WORK(&priv->watch_dog_wq, rtl819x_watchdog_wqcallback);
INIT_DELAYED_WORK(&priv->txpower_tracking_wq, dm_txpower_trackingcallback);
-// INIT_DELAYED_WORK(&priv->gpio_change_rf_wq, dm_gpio_change_rf_callback);
INIT_DELAYED_WORK(&priv->rfpath_check_wq, dm_rf_pathcheck_workitemcallback);
INIT_DELAYED_WORK(&priv->update_beacon_wq, rtl8192_update_beacon);
INIT_DELAYED_WORK(&priv->initialgain_operate_wq, InitialGainOperateWorkItemCallBack);
- //INIT_WORK(&priv->SwChnlWorkItem, rtl8192_SwChnl_WorkItem);
- //INIT_WORK(&priv->SetBWModeWorkItem, rtl8192_SetBWModeWorkItem);
INIT_WORK(&priv->qos_activate, rtl8192_qos_activate);
tasklet_init(&priv->irq_rx_tasklet,
int i = 0;
u8 queuetopipe[] = {3, 2, 1, 0, 4, 8, 7, 6, 5};
memcpy(priv->txqueue_to_outpipemap, queuetopipe, 9);
-/* for(i=0;i<9;i++)
- printk("%d ",priv->txqueue_to_outpipemap[i]);
- printk("\n");*/
}
#else
{
u8 queuetopipe[] = {3, 2, 1, 0, 4, 4, 0, 4, 4};
memcpy(priv->txqueue_to_outpipemap, queuetopipe, 9);
-/* for(i=0;i<9;i++)
- printk("%d ",priv->txqueue_to_outpipemap[i]);
- printk("\n");*/
}
#endif
rtl8192_init_priv_variable(dev);
return -ENOMEM;
}
- //rtl8192_adapter_start(dev);
#ifdef DEBUG_EPROM
dump_eprom(dev);
#endif
write_nic_byte_E(dev, 0x5e, 0x80);
write_nic_byte(dev, 0x17, 0x37);
mdelay(10);
-//#ifdef TO_DO_LIST
priv->pFirmware->firmware_status = FW_STATUS_0_INIT;
//config CPUReset Register
//Firmware Reset or not?
RT_TRACE(COMP_ERR, "ERROR in %s(): undefined firmware state(%d)\n", __func__, priv->pFirmware->firmware_status);
write_nic_dword(dev, CPU_GEN, dwRegRead);
- //mdelay(30);
//config BB.
rtl8192_BBConfig(dev);
//Loopback mode or not
priv->LoopbackMode = RTL819xU_NO_LOOPBACK;
-// priv->LoopbackMode = RTL819xU_MAC_LOOPBACK;
dwRegRead = read_nic_dword(dev, CPU_GEN);
if (priv->LoopbackMode == RTL819xU_NO_LOOPBACK)
NUM_OF_PAGE_IN_FW_QUEUE_CMD << RSVD_FW_QUEUE_PAGE_CMD_SHIFT);
write_nic_dword(dev, RQPN3, APPLIED_RESERVED_QUEUE_IN_FW| \
NUM_OF_PAGE_IN_FW_QUEUE_BCN<<RSVD_FW_QUEUE_PAGE_BCN_SHIFT
-// | NUM_OF_PAGE_IN_FW_QUEUE_PUB<<RSVD_FW_QUEUE_PAGE_PUB_SHIFT
);
write_nic_dword(dev, RATR0+4*7, (RATE_ALL_OFDM_AG | RATE_ALL_CCK));
// TODO: (it value is only for FPGA version). need to be changed!!2006.12.18, by Emily
write_nic_byte(dev, ACK_TIMEOUT, 0x30);
-// RT_TRACE(COMP_INIT, "%s():priv->ResetProgress is %d\n", __FUNCTION__,priv->ResetProgress);
if (priv->ResetProgress == RESET_TYPE_NORESET)
rtl8192_SetWirelessMode(dev, priv->ieee80211->mode);
if (priv->ResetProgress == RESET_TYPE_NORESET){
{
u32 i, TempCCk;
u32 tmpRegA = rtl8192_QueryBBReg(dev, rOFDM0_XATxIQImbalance, bMaskDWord);
- // u32 tmpRegC= rtl8192_QueryBBReg(dev,rOFDM0_XCTxIQImbalance,bMaskDWord);
for (i = 0; i < TxBBGainTableLength; i++)
{
if (tmpRegA == priv->txbbgain_table[i].txbbgain_value)
priv->cck_present_attentuation_difference = 0;
priv->cck_present_attentuation = priv->cck_present_attentuation_20Mdefault;
- // pMgntInfo->bTXPowerTracking = FALSE;//TEMPLY DISABLE
}
}
write_nic_byte(dev, 0x87, 0x0);
{
struct r8192_priv *priv = ieee80211_priv(dev);
u8 QueueID;
-// PRT_TCB pTcb;
-// u8 ResetThreshold;
bool bCheckFwTxCnt = false;
- //unsigned long flags;
//
// Decide such threshold according to current power save mode
//
-// RT_TRACE(COMP_RESET, " ==> TxCheckStuck()\n");
-// PlatformAcquireSpinLock(Adapter, RT_TX_SPINLOCK);
-// spin_lock_irqsave(&priv->ieee80211->lock,flags);
for (QueueID = 0; QueueID <= BEACON_QUEUE; QueueID ++)
{
if (QueueID == TXCMD_QUEUE)
bCheckFwTxCnt = true;
}
-// PlatformReleaseSpinLock(Adapter, RT_TX_SPINLOCK);
-// spin_unlock_irqrestore(&priv->ieee80211->lock,flags);
-// RT_TRACE(COMP_RESET,"bCheckFwTxCnt is %d\n",bCheckFwTxCnt);
if (bCheckFwTxCnt)
{
if (HalTxCheckStuck819xUsb(dev))
{
if (rx_chk_cnt < 4)
{
- //DbgPrint("RSSI < %d && RSSI >= %d, no check this time \n", RateAdaptiveTH_Low, VeryLowRSSI);
return bStuck;
}
else
{
rx_chk_cnt = 0;
- //DbgPrint("RSSI < %d && RSSI >= %d, check this time \n", RateAdaptiveTH_Low, VeryLowRSSI);
}
}
else
{
if (rx_chk_cnt < 8)
{
- //DbgPrint("RSSI <= %d, no check this time \n", VeryLowRSSI);
return bStuck;
}
else
{
rx_chk_cnt = 0;
- //DbgPrint("RSSI <= %d, check this time \n", VeryLowRSSI);
}
}
RxCheckStuck(struct net_device *dev)
{
struct r8192_priv *priv = ieee80211_priv(dev);
- //int i;
bool bRxCheck = FALSE;
-// RT_TRACE(COMP_RESET," ==> RxCheckStuck()\n");
- //PlatformAcquireSpinLock(Adapter, RT_RX_SPINLOCK);
-
if (priv->IrpPendingCount > 1)
bRxCheck = TRUE;
- //PlatformReleaseSpinLock(Adapter, RT_RX_SPINLOCK);
-// RT_TRACE(COMP_RESET,"bRxCheck is %d \n",bRxCheck);
if (bRxCheck)
{
if (HalRxCheckStuck819xUsb(dev))
TxResetType = TxCheckStuck(dev);
if (rfState != eRfOff ||
- /*ADAPTER_TEST_STATUS_FLAG(Adapter, ADAPTER_STATUS_FW_DOWNLOAD_FAILURE)) &&*/
(priv->ieee80211->iw_mode != IW_MODE_ADHOC))
{
// If driver is in the status of firmware download failure , driver skips RF initialization and RF is
void
rtl819x_ifsilentreset(struct net_device *dev)
{
- //OCTET_STRING asocpdu;
struct r8192_priv *priv = ieee80211_priv(dev);
u8 reset_times = 0;
int reset_status = 0;
// Set the variable for reset.
priv->ResetProgress = RESET_TYPE_SILENT;
-// rtl8192_close(dev);
down(&priv->wx_sem);
if (priv->up == 0)
{
}
priv->up = 0;
RT_TRACE(COMP_RESET, "%s():======>start to down the driver\n", __func__);
-// if(!netif_queue_stopped(dev))
-// netif_stop_queue(dev);
rtl8192_rtx_disable(dev);
rtl8192_cancel_deferred_work(priv);
ieee80211_softmac_stop_protocol(priv->ieee80211); }
up(&priv->wx_sem);
RT_TRACE(COMP_RESET, "%s():<==========down process is finished\n", __func__);
- //rtl8192_irq_disable(dev);
RT_TRACE(COMP_RESET, "%s():===========>start up the driver\n", __func__);
reset_status = _rtl8192_up(dev);
ieee->set_chan(ieee->dev, ieee->current_network.channel);
ieee->link_change(ieee->dev);
- // notify_wx_assoc_event(ieee);
-
ieee80211_start_send_beacons(ieee);
if (ieee->data_hard_resume)
u8 entry_i = 0;
u32 ulStatus;
s32 i = 100;
-// printk("=======>start read CAM\n");
for (entry_i = 0; entry_i < CAM_CONTENT_COUNT; entry_i++)
{
// polling bit, and No Write enable, and address
target_command = target_command | BIT31;
//Check polling bit is clear
-// mdelay(1);
while ((i--) >= 0)
{
ulStatus = read_nic_dword(dev, RWCAM);
}
write_nic_dword(dev, RWCAM, target_command);
RT_TRACE(COMP_SEC, "CAM_read_entry(): WRITE A0: %x \n", target_command);
- // printk("CAM_read_entry(): WRITE A0: %lx \n",target_command);
target_content = read_nic_dword(dev, RCAMO);
RT_TRACE(COMP_SEC, "CAM_read_entry(): WRITE A8: %x \n", target_content);
- // printk("CAM_read_entry(): WRITE A8: %lx \n",target_content);
}
printk("\n");
}
RT_TRACE(COMP_ERR, "========>%s()\n", __func__);
#endif
netdev_dbg(dev, "===>%s(): AP is power off, connect another one\n", __func__);
- // Dot11d_Reset(dev);
priv->ieee80211->state = IEEE80211_ASSOCIATING;
notify_wx_assoc_event(priv->ieee80211);
RemovePeerTS(priv->ieee80211, priv->ieee80211->current_network.bssid);
priv->ieee80211->LinkDetectInfo.NumRecvBcnInPeriod = 0;
priv->ieee80211->LinkDetectInfo.NumRecvDataInPeriod = 0;
}
-// CAM_read_entry(dev,4);
//check if reset the driver
if (check_reset_cnt++ >= 3)
{
ResetType = rtl819x_ifcheck_resetornot(dev);
check_reset_cnt = 3;
- //DbgPrint("Start to check silent reset\n");
}
- // RT_TRACE(COMP_RESET,"%s():priv->force_reset is %d,priv->ResetProgress is %d, priv->bForcedSilentReset is %d,priv->bDisableNormalResetCheck is %d,ResetType is %d\n",__FUNCTION__,priv->force_reset,priv->ResetProgress,priv->bForcedSilentReset,priv->bDisableNormalResetCheck,ResetType);
if ((priv->force_reset) || (priv->ResetProgress == RESET_TYPE_NORESET &&
(priv->bForcedSilentReset ||
(!priv->bDisableNormalResetCheck && ResetType == RESET_TYPE_SILENT)))) // This is control by OID set in Pomelo
void watch_dog_timer_callback(unsigned long data)
{
struct r8192_priv *priv = ieee80211_priv((struct net_device *) data);
- //printk("===============>watch_dog timer\n");
queue_delayed_work(priv->priv_wq, &priv->watch_dog_wq, 0);
mod_timer(&priv->watch_dog_timer, jiffies + MSECS(IEEE80211_WATCH_DOG_TIME));
}
int _rtl8192_up(struct net_device *dev)
{
struct r8192_priv *priv = ieee80211_priv(dev);
- //int i;
int init_status = 0;
priv->up = 1;
priv->ieee80211->ieee_up = 1;
}
RT_TRACE(COMP_INIT, "start adapter finished\n");
rtl8192_rx_enable(dev);
-// rtl8192_tx_enable(dev);
if (priv->ieee80211->state != IEEE80211_LINKED)
ieee80211_softmac_start_protocol(priv->ieee80211);
ieee80211_reset_queue(priv->ieee80211);
netif_stop_queue(dev);
rtl8192_rtx_disable(dev);
- //rtl8192_irq_disable(dev);
/* Tx related queue release */
for (i = 0; i < MAX_QUEUE_SIZE; i++) {
}
//as cancel_delayed_work will del work->timer, so if work is not defined as struct delayed_work, it will corrupt
-// flush_scheduled_work();
rtl8192_cancel_deferred_work(priv);
deinit_hal_dm(dev);
del_timer_sync(&priv->watch_dog_timer);
{
struct r8192_priv *priv = ieee80211_priv(dev);
int reset_status = 0;
- //u8 reset_times = 0;
if (priv->up == 0) return;
priv->up = 0;
rtl8192_cancel_deferred_work(priv);
del_timer_sync(&priv->watch_dog_timer);
- //cancel_delayed_work(&priv->SwChnlWorkItem);
ieee80211_softmac_stop_protocol(priv->ieee80211);
- //rtl8192_irq_disable(dev);
rtl8192_rtx_disable(dev);
reset_status = _rtl8192_up(dev);
}
-/*
-void rtl8192_restart(struct net_device *dev)
-{
- struct r8192_priv *priv = ieee80211_priv(dev);
-*/
void rtl8192_restart(struct work_struct *work)
{
struct r8192_priv *priv = container_of(work, struct r8192_priv, reset_wq);
struct r8192_priv *priv = ieee80211_priv(dev);
short promisc;
- //down(&priv->wx_sem);
-
/* FIXME FIXME */
promisc = (dev->flags & IFF_PROMISC) ? 1:0;
if (promisc != priv->promisc)
- // rtl8192_commit(dev);
priv->promisc = promisc;
-
- //schedule_work(&priv->reset_wq);
- //up(&priv->wx_sem);
}
u32 key[4];
u8 broadcast_addr[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
struct iw_point *p = &wrq->u.data;
- struct ieee_param *ipw = NULL;//(struct ieee_param *)wrq->u.data.pointer;
+ struct ieee_param *ipw = NULL;
down(&priv->wx_sem);
setKey(dev, ipw->u.crypt.idx, ipw->u.crypt.idx, ieee->pairwise_key_type, (u8 *)ieee->ap_mac_addr, 0, key);
}
}
- else //if (ipw->u.crypt.idx) //group key use idx > 0
+ else
{
memcpy((u8 *)key, ipw->u.crypt.key, 16);
if (strcmp(ipw->u.crypt.alg, "CCMP") == 0)
bool bcheck = false;
u8 rfpath;
u32 nspatial_stream, tmp_val;
- //u8 i;
static u32 slide_rssi_index, slide_rssi_statistics;
static u32 slide_evm_index, slide_evm_statistics;
static u32 last_rssi, last_evm;
if (priv->stats.rx_rssi_percentage[rfpath] == 0)
{
priv->stats.rx_rssi_percentage[rfpath] = pprevious_stats->RxMIMOSignalStrength[rfpath];
- //DbgPrint("MIMO RSSI initialize \n");
}
if (pprevious_stats->RxMIMOSignalStrength[rfpath] > priv->stats.rx_rssi_percentage[rfpath])
{
slide_beacon_adc_pwdb_statistics = PHY_Beacon_RSSI_SLID_WIN_MAX;
last_beacon_adc_pwdb = priv->stats.Slide_Beacon_pwdb[slide_beacon_adc_pwdb_index];
priv->stats.Slide_Beacon_Total -= last_beacon_adc_pwdb;
- //DbgPrint("slide_beacon_adc_pwdb_index = %d, last_beacon_adc_pwdb = %d, Adapter->RxStats.Slide_Beacon_Total = %d\n",
- // slide_beacon_adc_pwdb_index, last_beacon_adc_pwdb, Adapter->RxStats.Slide_Beacon_Total);
}
priv->stats.Slide_Beacon_Total += pprevious_stats->RxPWDBAll;
priv->stats.Slide_Beacon_pwdb[slide_beacon_adc_pwdb_index] = pprevious_stats->RxPWDBAll;
- //DbgPrint("slide_beacon_adc_pwdb_index = %d, pPreviousRfd->Status.RxPWDBAll = %d\n", slide_beacon_adc_pwdb_index, pPreviousRfd->Status.RxPWDBAll);
slide_beacon_adc_pwdb_index++;
if (slide_beacon_adc_pwdb_index >= PHY_Beacon_RSSI_SLID_WIN_MAX)
slide_beacon_adc_pwdb_index = 0;
if (priv->undecorated_smoothed_pwdb < 0) // initialize
{
priv->undecorated_smoothed_pwdb = pprevious_stats->RxPWDBAll;
- //DbgPrint("First pwdb initialize \n");
}
if (pprevious_stats->RxPWDBAll > (u32)priv->undecorated_smoothed_pwdb)
{
bool bToSelfBA
)
{
- //PRT_RFD_STATUS pRtRfdStatus = &(pRfd->Status);
phy_sts_ofdm_819xusb_t *pofdm_buf;
phy_sts_cck_819xusb_t *pcck_buf;
phy_ofdm_rx_status_rxsc_sgien_exintfflag *prxsc;
u8 *prxpkt;
u8 i, max_spatial_stream, tmp_rxsnr, tmp_rxevm, rxsc_sgien_exflg;
char rx_pwr[4], rx_pwr_all = 0;
- //long rx_avg_pwr = 0;
char rx_snrX, rx_evmX;
u8 evm, pwdb_all;
- u32 RSSI, total_rssi = 0;//, total_evm=0;
-// long signal_strength_index = 0;
+ u32 RSSI, total_rssi = 0;
u8 is_cck_rate = 0;
u8 rf_rx_num = 0;
memset(precord_stats, 0, sizeof(struct ieee80211_rx_stats));
pstats->bPacketMatchBSSID = precord_stats->bPacketMatchBSSID = bpacket_match_bssid;
pstats->bPacketToSelf = precord_stats->bPacketToSelf = bpacket_toself;
- pstats->bIsCCK = precord_stats->bIsCCK = is_cck_rate;//RX_HAL_IS_CCK_RATE(pDrvInfo);
+ pstats->bIsCCK = precord_stats->bIsCCK = is_cck_rate;
pstats->bPacketBeacon = precord_stats->bPacketBeacon = bPacketBeacon;
pstats->bToSelfBA = precord_stats->bToSelfBA = bToSelfBA;
//
// (2)PWDB, Average PWDB cacluated by hardware (for rate adaptive)
//
- u8 report;//, cck_agc_rpt;
+ u8 report;
priv->stats.numqry_phystatusCCK++;
//
// (3) Get Signal Quality (EVM)
//
- //if(bpacket_match_bssid)
{
u8 sq;
//Get Rx snr value in DB
tmp_rxsnr = pofdm_buf->rxsnr_X[i];
rx_snrX = (char)(tmp_rxsnr);
- //rx_snrX >>= 1;
rx_snrX /= 2;
priv->stats.rxSNRdB[i] = (long)rx_snrX;
total_rssi += RSSI;
/* Record Signal Strength for next packet */
- //if(bpacket_match_bssid)
{
pstats->RxMIMOSignalStrength[i] = (u8) RSSI;
precord_stats->RxMIMOSignalStrength[i] = (u8) RSSI;
rx_evmX /= 2; //dbm
evm = rtl819x_evm_dbtopercentage(rx_evmX);
- //if(bpacket_match_bssid)
{
if (i == 0) // Fill value in RFD, Get the first spatial stream only
pstats->SignalQuality = precord_stats->SignalQuality = (u8)(evm & 0xff);
//It is assigned to the BSS List in GetValueFromBeaconOrProbeRsp().
if (is_cck_rate)
{
- pstats->SignalStrength = precord_stats->SignalStrength = (u8)(rtl819x_signal_scale_mapping((long)pwdb_all));//PWDB_ALL;
+ pstats->SignalStrength = precord_stats->SignalStrength = (u8)(rtl819x_signal_scale_mapping((long)pwdb_all));
}
else
{
- //pRfd->Status.SignalStrength = pRecordRfd->Status.SignalStrength = (u8)(SignalScaleMapping(total_rssi/=RF90_PATH_MAX));//(u8)(total_rssi/=RF90_PATH_MAX);
// We can judge RX path number now.
if (rf_rx_num != 0)
pstats->SignalStrength = precord_stats->SignalStrength = (u8)(rtl819x_signal_scale_mapping((long)(total_rssi /= rf_rx_num)));
// Get Signal Quality for only RX data queue (but not command queue)
u8 *tmp_buf;
- //u16 tmp_buf_len = 0;
u8 *praddr;
/* Get MAC frame start address. */
- tmp_buf = (u8 *)skb->data;// + get_rxpacket_shiftbytes_819xusb(pstats);
+ tmp_buf = (u8 *)skb->data;
hdr = (struct ieee80211_hdr_3addr *)tmp_buf;
fc = le16_to_cpu(hdr->frame_ctl);
if (WLAN_FC_GET_FRAMETYPE(fc) == IEEE80211_STYPE_BEACON)
{
bPacketBeacon = true;
- //DbgPrint("Beacon 2, MatchBSSID = %d, ToSelf = %d \n", bPacketMatchBSSID, bPacketToSelf);
}
if (WLAN_FC_GET_FRAMETYPE(fc) == IEEE80211_STYPE_BLOCKACK)
{
if ((eqMacAddr(praddr, dev->dev_addr)))
bToSelfBA = true;
- //DbgPrint("BlockAck, MatchBSSID = %d, ToSelf = %d \n", bPacketMatchBSSID, bPacketToSelf);
}
rtl8192_rx_info *info = (struct rtl8192_rx_info *)skb->cb;
struct net_device *dev = info->dev;
struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
- //rx_desc_819x_usb *desc = (rx_desc_819x_usb *)skb->data;
rx_drvinfo_819x_usb *driver_info = NULL;
//
stats->Length = desc->Length;
stats->RxDrvInfoSize = desc->RxDrvInfoSize;
- stats->RxBufShift = 0;//desc->Shift&0x03;
+ stats->RxBufShift = 0;
stats->bICV = desc->ICV;
stats->bCRC = desc->CRC32;
stats->bHwError = stats->bCRC|stats->bICV;
stats->bFirstMPDU = (driver_info->PartAggr == 1) && (driver_info->FirstAGGR == 1);
stats->TimeStampLow = driver_info->TSFL;
// xiong mask it, 070514
- //pRfd->Status.TimeStampHigh = PlatformEFIORead4Byte(Adapter, TSFR+4);
- // stats->TimeStampHigh = read_nic_dword(dev, TSFR+4);
UpdateRxPktTimeStamp8190(dev, stats);
.signal = 0,
.noise = -98,
.rate = 0,
- // .mac_time = jiffies,
.freq = IEEE80211_24GHZ_BAND,
};
u32 rx_pkt_len = 0;
#ifdef USB_RX_AGGREGATION_SUPPORT
if (TempByte & BIT0) {
agg_skb = skb;
- //TotalLength = agg_skb->len - 4; /*sCrcLng*/
TotalLength = stats.Length - 4; /*sCrcLng*/
- //RT_TRACE(COMP_RECV, "%s:first aggregated packet!Length=%d\n",__FUNCTION__,TotalLength);
/* though the head pointer has passed this position */
TempDWord = *(u32 *)(agg_skb->data - 4);
PacketLength = (u16)(TempDWord & 0x3FFF); /*sCrcLng*/
}
#ifdef USB_RX_AGGREGATION_SUPPORT
testing = 1;
- // (PipeIndex == 0) && (TempByte & BIT0) => TotalLength > 0.
if (TotalLength > 0) {
PacketOccupiedLendth = PacketLength + (PacketShiftBytes + 8);
if ((PacketOccupiedLendth & 0xFF) != 0)
while (agg_skb->len >= GetRxPacketShiftBytes819xUsb(&stats, true)) {
u8 tmpCRC = 0, tmpICV = 0;
- //RT_TRACE(COMP_RECV,"%s:aggred pkt,total_len = %d\n",__FUNCTION__,agg_skb->len);
RxDescr = (rx_desc_819x_usb_aggr_subframe *)(agg_skb->data);
tmpCRC = RxDescr->CRC32;
tmpICV = RxDescr->ICV;
struct ieee80211_rx_stats *pstats
)
{
-// bool bfreerfd=false, bqueued=false;
u8 *frame;
u16 frame_len = 0;
struct r8192_priv *priv = ieee80211_priv(dev);
-// u8 index = 0;
-// u8 TID = 0;
- //u16 seqnum = 0;
- //PRX_TS_RECORD pts = NULL;
// Get shifted bytes of Starting address of 802.11 header. 2006.09.28, by Emily
//porting by amy 080508
void query_rx_cmdpkt_desc_status(struct sk_buff *skb, struct ieee80211_rx_stats *stats)
{
-// rtl8192_rx_info *info = (struct rtl8192_rx_info *)skb->cb;
-// struct net_device *dev=info->dev;
-// struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
rx_desc_819x_usb *desc = (rx_desc_819x_usb *)skb->data;
-// rx_drvinfo_819x_usb *driver_info;
//
//Get Rx Descriptor Information
{
struct rtl8192_rx_info *info = (struct rtl8192_rx_info *)skb->cb;
struct net_device *dev = info->dev;
- //int ret;
-// struct urb *rx_urb = info->urb;
/* TODO */
struct ieee80211_rx_stats stats = {
.signal = 0,
.noise = -98,
.rate = 0,
- // .mac_time = jiffies,
.freq = IEEE80211_24GHZ_BAND,
};
switch (info->out_pipe) {
/* Nomal packet pipe */
case 3:
- //RT_TRACE(COMP_RECV, "normal in-pipe index(%d)\n",info->out_pipe);
priv->IrpPendingCount--;
rtl8192_rx_nomal(skb);
break;
static int rtl8192_usb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
-// unsigned long ioaddr = 0;
struct net_device *dev = NULL;
struct r8192_priv *priv = NULL;
struct usb_device *udev = interface_to_usbdev(intf);
dev->netdev_ops = &rtl8192_netdev_ops;
- //DMESG("Oops: i'm coming\n");
#if WIRELESS_EXT >= 12
#if WIRELESS_EXT < 17
dev->get_wireless_stats = r8192_get_wireless_stats;
cancel_delayed_work(&priv->watch_dog_wq);
cancel_delayed_work(&priv->update_beacon_wq);
cancel_work_sync(&priv->qos_activate);
- //cancel_work_sync(&priv->SetBWModeWorkItem);
- //cancel_work_sync(&priv->SwChnlWorkItem);
-
}
rtl8192_down(dev);
kfree(priv->pFirmware);
priv->pFirmware = NULL;
- // priv->rf_close(dev);
-// rtl8192_SetRFPowerState(dev, eRfOff);
rtl8192_usb_deleteendpoints(dev);
destroy_workqueue(priv->priv_wq);
- //rtl8192_irq_disable(dev);
- //rtl8192_reset(dev);
mdelay(10);
}
usb_deregister(&rtl8192_usb_driver);
RT_TRACE(COMP_DOWN, "Exiting");
-// rtl8192_proc_module_remove();
}
ieee->hwsec_active = 1;
- if ((ieee->pHTInfo->IOTAction&HT_IOT_ACT_PURE_N_MODE) || !hwwep)//!ieee->hwsec_support) //add hwsec_support flag to totol control hw_sec on/off
+ if ((ieee->pHTInfo->IOTAction&HT_IOT_ACT_PURE_N_MODE) || !hwwep) //add hwsec_support flag to totol control hw_sec on/off
{
ieee->hwsec_active = 0;
SECR_value &= ~SCR_RxDecEnable;
RT_TRACE(COMP_SEC, "%s:, hwsec:%d, pairwise_key:%d, SECR_value:%x\n", __func__, \
ieee->hwsec_active, ieee->pairwise_key_type, SECR_value);
{
- write_nic_byte(dev, SECR, SECR_value);//SECR_value | SCR_UseDK );
+ write_nic_byte(dev, SECR, SECR_value);
}
}
usConfig |= BIT15 | (KeyType<<2);
else
usConfig |= BIT15 | (KeyType<<2) | KeyIndex;
-// usConfig |= BIT15 | (KeyType<<2) | (DefaultKey<<5) | KeyIndex;
for (i = 0; i < CAM_CONTENT_COUNT; i++){
write_nic_dword(dev, WCAMI, TargetContent);
write_nic_dword(dev, RWCAM, TargetCommand);
- // printk("setkey cam =%8x\n", read_cam(dev, i+6*EntryNo));
}
else if (i == 1){//MAC
TargetContent = (u32)(*(MacAddr+2)) |