25 #undef RX_DONT_PASS_UL
27 #undef DEBUG_RX_VERBOSE
33 #undef DEBUG_TX_FILLDESC
38 #undef DEBUG_REGISTERS
40 #undef DEBUG_IRQ_TASKLET
45 #include <linux/pci.h>
60 static char *ifname =
"wlan%d";
72 .rx_command_packet_handler =
NULL,
98 static struct pci_driver rtl8192_pci_driver = {
100 .id_table = rtl8192_pci_id_tbl,
101 .probe = rtl8192_pci_probe,
110 static bool PlatformIOCheckPageLegalAndGetRegMask(
u32 u4bPage,
u8 *pu1bPageMask)
112 bool bReturn =
false;
114 *pu1bPageMask = 0xfe;
117 case 1:
case 2:
case 3:
case 4:
118 case 8:
case 9:
case 10:
case 12:
case 13:
120 *pu1bPageMask = 0xf0;
133 u32 u4bPage = (x >> 8);
135 bool bIsLegalPage =
false;
141 bIsLegalPage = PlatformIOCheckPageLegalAndGetRegMask(u4bPage,
156 u32 u4bPage = (x >> 8);
158 bool bIsLegalPage =
false;
163 bIsLegalPage = PlatformIOCheckPageLegalAndGetRegMask(u4bPage,
179 u32 u4bPage = (x >> 8);
181 bool bIsLegalPage =
false;
186 bIsLegalPage = PlatformIOCheckPageLegalAndGetRegMask(u4bPage,
201 u32 u4bPage = (x >> 8);
203 bool bIsLegalPage =
false;
209 bIsLegalPage = PlatformIOCheckPageLegalAndGetRegMask(u4bPage,
226 u32 u4bPage = (x >> 8);
228 bool bIsLegalPage =
false;
234 bIsLegalPage = PlatformIOCheckPageLegalAndGetRegMask(u4bPage,
252 u32 u4bPage = (x >> 8);
254 bool bIsLegalPage =
false;
260 bIsLegalPage = PlatformIOCheckPageLegalAndGetRegMask(u4bPage,
322 bool bActionAllowed =
false;
323 bool bConnectBySSID =
false;
325 u16 RFWaitCounter = 0;
328 "StateToSet(%d)\n", StateToSet);
330 ProtectOrNot =
false;
337 spin_unlock_irqrestore(&priv->
rf_ps_lock, flag);
339 "MgntActSet_RF_State(): RF Change in "
340 "progress! Wait to set..StateToSet"
341 "(%d).\n", StateToSet);
346 "MgntActSet_RF_State(): Wait 1"
347 " ms (%d times)...\n",
351 if (RFWaitCounter > 100) {
353 "RF_State(): Wait too "
360 spin_unlock_irqrestore(&priv->
rf_ps_lock, flag);
366 rtState = priv->
rtllib->eRFPowerState;
368 switch (StateToSet) {
370 priv->
rtllib->RfOffReason &= (~ChangeSource);
376 if (!priv->
rtllib->RfOffReason) {
377 priv->
rtllib->RfOffReason = 0;
378 bActionAllowed =
true;
383 bConnectBySSID =
true;
386 "eRfon reject pMgntInfo->RfOffReason= 0x%x,"
387 " ChangeSource=0x%X\n",
388 priv->
rtllib->RfOffReason, ChangeSource);
410 priv->
rtllib->RfOffReason |= ChangeSource;
411 bActionAllowed =
true;
415 priv->
rtllib->RfOffReason |= ChangeSource;
416 bActionAllowed =
true;
423 if (bActionAllowed) {
425 " allowed.... StateToSet(%d), RfOffReason(%#X)\n",
426 StateToSet, priv->
rtllib->RfOffReason);
428 if (StateToSet ==
eRfOn) {
438 "Action is rejected.... StateToSet(%d), ChangeSource"
439 "(%#X), RfOffReason(%#X)\n", StateToSet, ChangeSource,
440 priv->
rtllib->RfOffReason);
446 spin_unlock_irqrestore(&priv->
rf_ps_lock, flag);
450 return bActionAllowed;
464 "queue_len=%d---------\n", prio, ring->
idx,
465 skb_queue_len(&ring->
queue));
466 return skb_queue_len(&ring->
queue);
469 static short rtl8192_check_nic_enough_desc(
struct net_device *dev,
int prio)
492 priv->
ops->irq_enable(dev);
499 priv->
ops->irq_disable(dev);
526 ShortPreamble =
true;
529 "PREAMBLE\n", __func__);
531 (
unsigned char *)&ShortPreamble);
535 ShortPreamble =
false;
538 "PREAMBLE\n", __func__);
540 (
unsigned char *)&ShortPreamble);
549 (!priv->
rtllib->pHTInfo->bCurrentRT2RTLongSlotTime)) {
552 priv->
rtllib->SetHwRegHandler(dev,
558 priv->
rtllib->SetHwRegHandler(dev,
581 if (ieee->
pHTInfo->bCurrentHTSupport)
583 ieee->
pHTInfo->bCurrentRT2RTLongSlotTime =
584 net->
bssht.bdRT2RTLongSlotTime;
585 ieee->
pHTInfo->RT2RT_HT_Mode = net->
bssht.RT2RT_HT_Mode;
612 static int rtl8192_qos_handle_probe_response(
struct r8192_priv *priv,
626 if (active_network &&
630 if ((network->
qos_data.active == 1) && (active_network == 1) &&
632 (network->
qos_data.old_param_count !=
642 memcpy(&priv->
rtllib->current_network.qos_data.parameters,
643 &def_qos_parameters, size);
645 if ((network->
qos_data.active == 1) && (active_network == 1)) {
657 static int rtl8192_handle_beacon(
struct net_device *dev,
663 rtl8192_qos_handle_probe_response(priv, 1, network);
670 static int rtl8192_qos_association_resp(
struct r8192_priv *priv,
676 int set_qos_param = 0;
678 if ((priv ==
NULL) || (network ==
NULL))
689 memcpy(&priv->
rtllib->current_network.qos_data.parameters,
692 priv->
rtllib->current_network.qos_data.active = 1;
695 priv->
rtllib->current_network.qos_data.old_param_count =
696 priv->
rtllib->current_network.qos_data.param_count;
697 priv->
rtllib->current_network.qos_data.param_count =
700 memcpy(&priv->
rtllib->current_network.qos_data.parameters,
701 &def_qos_parameters, size);
702 priv->
rtllib->current_network.qos_data.active = 0;
703 priv->
rtllib->current_network.qos_data.supported = 0;
707 spin_unlock_irqrestore(&priv->
rtllib->lock, flags);
710 network->
flags, priv->
rtllib->current_network.qos_data.active);
711 if (set_qos_param == 1) {
718 static int rtl8192_handle_assoc_response(
struct net_device *dev,
723 rtl8192_qos_association_resp(priv, network);
727 static void rtl8192_prepare_beacon(
struct r8192_priv *priv)
736 pskb = __skb_dequeue(&ring->
queue);
743 tcb_desc = (
struct cb_desc *)(pnewskb->cb + 8);
751 pdesc = &ring->
desc[0];
752 priv->
ops->tx_fill_descriptor(dev, pdesc, tcb_desc, pnewskb);
753 __skb_queue_tail(&ring->
queue, pnewskb);
759 static void rtl8192_stop_beacon(
struct net_device *dev)
767 u8 i = 0, basic_rate = 0;
768 net = &priv->
rtllib->current_network;
771 basic_rate = net->
rates[
i] & 0x7f;
772 switch (basic_rate) {
814 switch (basic_rate) {
899 ((wireless_mode & bSupportMode) == 0)) {
912 "supported (%x)!!!\n", __func__, bSupportMode);
928 priv->
rtllib->pHTInfo->bEnableHT = 1;
930 __func__, wireless_mode);
932 priv->
rtllib->pHTInfo->bEnableHT = 0;
934 __func__, wireless_mode);
941 static int _rtl8192_sta_up(
struct net_device *dev,
bool is_silent_reset)
945 (&(priv->
rtllib->PowerSaveControl));
946 bool init_status =
true;
951 priv->
rtllib->ieee_up = 1;
956 init_status = priv->
ops->initialize_adapter(dev);
957 if (init_status !=
true) {
976 if (!netif_queue_stopped(dev))
977 netif_start_queue(dev);
979 netif_wake_queue(dev);
984 static int rtl8192_sta_down(
struct net_device *dev,
bool shutdownrf)
987 unsigned long flags = 0;
988 u8 RFInProgressTimeOut = 0;
994 priv->
rtllib->rtllib_ips_leave(dev);
1001 priv->
rtllib->ieee_up = 0;
1004 if (!netif_queue_stopped(dev))
1005 netif_stop_queue(dev);
1007 priv->
rtllib->wpa_ie_len = 0;
1021 spin_unlock_irqrestore(&priv->
rf_ps_lock, flags);
1022 if (RFInProgressTimeOut > 100) {
1027 "until rf change is done.\n", __func__);
1029 RFInProgressTimeOut++;
1033 spin_unlock_irqrestore(&priv->
rf_ps_lock, flags);
1034 priv->
ops->stop_adapter(dev,
false);
1037 spin_unlock_irqrestore(&priv->
rf_ps_lock, flags);
1046 static void rtl8192_init_priv_handler(
struct net_device *dev)
1052 priv->
rtllib->link_change = priv->
ops->link_change;
1056 priv->
rtllib->check_nic_enough_desc = rtl8192_check_nic_enough_desc;
1057 priv->
rtllib->get_nic_desc_num = rtl8192_get_nic_desc_num;
1058 priv->
rtllib->handle_assoc_response = rtl8192_handle_assoc_response;
1059 priv->
rtllib->handle_beacon = rtl8192_handle_beacon;
1066 priv->
rtllib->stop_send_beacons = rtl8192_stop_beacon;
1073 priv->
rtllib->GetHalfNmodeSupportByAPsHandler =
1084 priv->
rtllib->UpdateBeaconInterruptHandler =
NULL;
1091 static void rtl8192_init_priv_constant(
struct net_device *dev)
1095 &(priv->
rtllib->PowerSaveControl);
1111 static void rtl8192_init_priv_variable(
struct net_device *dev)
1118 priv->
rtllib->hwscan_sem_up = 1;
1119 priv->
rtllib->status = 0;
1145 priv->
rtllib->bNetPromiscuousMode =
false;
1146 priv->
rtllib->IntelPromiscuousModeInfo.bPromiscuousOn =
false;
1147 priv->
rtllib->IntelPromiscuousModeInfo.bFilterSourceStationFrame =
1149 priv->
rtllib->ieee_up = 0;
1153 priv->
rtllib->rate = 110;
1154 priv->
rtllib->short_slot = 1;
1171 priv->
rtllib->wx_set_enc = 0;
1176 priv->
rtllib->RfOffReason = 0;
1180 priv->
rtllib->PowerSaveControl.bInactivePs =
true;
1181 priv->
rtllib->PowerSaveControl.bIPSModeBackup =
false;
1182 priv->
rtllib->PowerSaveControl.bLeisurePs =
true;
1183 priv->
rtllib->PowerSaveControl.bFwCtrlLPS =
false;
1184 priv->
rtllib->LPSDelayCnt = 0;
1196 priv->
rtllib->active_scan = 1;
1197 priv->
rtllib->be_scan_inprogress =
false;
1200 priv->
rtllib->host_encrypt = 1;
1201 priv->
rtllib->host_decrypt = 1;
1205 priv->
rtllib->MaxMssDensity = 0;
1206 priv->
rtllib->MinSpaceCfg = 0;
1216 skb_queue_head_init(&priv->
rx_queue);
1220 skb_queue_head_init(&priv->
rtllib->skb_waitQ[i]);
1222 skb_queue_head_init(&priv->
rtllib->skb_aggQ[i]);
1225 static void rtl8192_init_priv_lock(
struct r8192_priv *priv)
1235 sema_init(&priv->
wx_sem, 1);
1236 sema_init(&priv->
rf_sem, 1);
1240 static void rtl8192_init_priv_task(
struct net_device *dev)
1262 (
unsigned long)priv);
1265 (
unsigned long)priv);
1267 (
void(*)(
unsigned long))rtl8192_prepare_beacon,
1268 (
unsigned long)priv);
1291 for (i = 1; i <= 11; i++)
1292 (priv->
rtllib->active_channel_map)[
i] = 1;
1293 (priv->
rtllib->active_channel_map)[12] = 2;
1294 (priv->
rtllib->active_channel_map)[13] = 2;
1305 rtl8192_init_priv_handler(dev);
1306 rtl8192_init_priv_constant(dev);
1307 rtl8192_init_priv_variable(dev);
1308 rtl8192_init_priv_lock(priv);
1309 rtl8192_init_priv_task(dev);
1310 priv->
ops->get_eeprom_size(dev);
1311 priv->
ops->init_adapter_variable(dev);
1319 (
unsigned long) dev);
1324 (
unsigned long)dev);
1355 if (skb_queue_len(&(&priv->
tx_ring[i])->queue) > 0) {
1357 i, skb_queue_len(&(&priv->
tx_ring[i])->queue));
1369 bool bCheckFwTxCnt =
false;
1373 unsigned long flags = 0;
1375 switch (priv->
rtllib->ps) {
1394 ring = &priv->
tx_ring[QueueID];
1396 if (skb_queue_len(&ring->
queue) == 0) {
1400 tcb_desc = (
struct cb_desc *)(skb->cb +
1403 bCheckFwTxCnt =
true;
1406 "StuckCount=%d\n", __func__, QueueID,
1410 spin_unlock_irqrestore(&priv->
irq_th_lock, flags);
1412 if (bCheckFwTxCnt) {
1413 if (priv->
ops->TxCheckStuckHandler(dev)) {
1415 " Tx condition!\n");
1427 if (priv->
ops->RxCheckStuckHandler(dev)) {
1442 rfState = priv->
rtllib->eRFPowerState;
1444 if (rfState ==
eRfOn)
1445 TxResetType = rtl819x_TxCheckStuck(dev);
1447 if (rfState ==
eRfOn &&
1450 RxResetType = rtl819x_RxCheckStuck(dev);
1455 __func__, TxResetType, RxResetType);
1460 __func__, TxResetType, RxResetType);
1468 static void rtl819x_silentreset_mesh_bk(
struct net_device *dev,
u8 IsPortal)
1491 spin_unlock_irqrestore(&priv->
rf_ps_lock, flag);
1496 spin_unlock_irqrestore(&priv->
rf_ps_lock, flag);
1507 "return\n", __func__);
1517 " to down the driver\n", __func__);
1519 if (!netif_queue_stopped(dev))
1520 netif_stop_queue(dev);
1546 "finished\n", __func__);
1553 "finished\n", __func__);
1554 if (reset_status == -1) {
1555 if (reset_times < 3) {
1560 "Failed!!\n", __func__);
1568 spin_unlock_irqrestore(&priv->
rf_ps_lock, flag);
1593 rtl819x_silentreset_mesh_bk(dev, IsPortal);
1612 u32 *TotalRxDataNum)
1618 *TotalRxDataNum = 0;
1620 SlotIndex = (priv->
rtllib->LinkDetectInfo.SlotIndex++) %
1621 (priv->
rtllib->LinkDetectInfo.SlotNum);
1622 priv->
rtllib->LinkDetectInfo.RxBcnNum[SlotIndex] =
1623 priv->
rtllib->LinkDetectInfo.NumRecvBcnInPeriod;
1624 priv->
rtllib->LinkDetectInfo.RxDataNum[SlotIndex] =
1625 priv->
rtllib->LinkDetectInfo.NumRecvDataInPeriod;
1626 for (i = 0; i < priv->
rtllib->LinkDetectInfo.SlotNum; i++) {
1627 *TotalRxBcnNum += priv->
rtllib->LinkDetectInfo.RxBcnNum[
i];
1628 *TotalRxDataNum += priv->
rtllib->LinkDetectInfo.RxDataNum[
i];
1640 static u8 check_reset_cnt;
1641 unsigned long flags;
1643 (&(priv->
rtllib->PowerSaveControl));
1644 bool bBusyTraffic =
false;
1645 bool bHigherBusyTraffic =
false;
1646 bool bHigherBusyRxTraffic =
false;
1647 bool bEnterPS =
false;
1653 if (priv->
rtllib->CntAfterLink < 2)
1654 priv->
rtllib->CntAfterLink++;
1656 priv->
rtllib->CntAfterLink = 0;
1679 bBusyTraffic =
true;
1684 bHigherBusyTraffic =
true;
1686 bHigherBusyRxTraffic =
true;
1688 bHigherBusyRxTraffic =
false;
1717 ieee->
LinkDetectInfo.bHigherBusyRxTraffic = bHigherBusyRxTraffic;
1720 u32 TotalRxBcnNum = 0;
1721 u32 TotalRxDataNum = 0;
1725 if ((TotalRxBcnNum+TotalRxDataNum) == 0)
1736 " connect another one\n", __func__, priv->
chan);
1741 priv->
rtllib->current_network.bssid);
1764 if ((check_reset_cnt++ >= 3) && (!ieee->
is_roaming) &&
1767 check_reset_cnt = 3;
1769 spin_unlock_irqrestore(&priv->
tx_lock, flags);
1800 priv->
ops->rx_enable(dev);
1807 priv->
ops->tx_enable(dev);
1813 static void rtl8192_free_rx_ring(
struct net_device *dev)
1816 int i, rx_queue_idx;
1825 pci_unmap_single(priv->
pdev,
1832 sizeof(*priv->
rx_ring[rx_queue_idx]) *
1840 static void rtl8192_free_tx_ring(
struct net_device *dev,
unsigned int prio)
1845 while (skb_queue_len(&ring->
queue)) {
1887 memcpy((
unsigned char *)(skb->cb), &dev,
sizeof(dev));
1895 priv->
rtllib->stats.tx_bytes += (skb->
len -
1896 priv->
rtllib->tx_headroom);
1897 priv->
rtllib->stats.tx_packets++;
1920 memcpy((
unsigned char *)(skb->cb), &dev,
sizeof(dev));
1943 static void rtl8192_tx_isr(
struct net_device *dev,
int prio)
1949 while (skb_queue_len(&ring->
queue)) {
1959 skb = __skb_dequeue(&ring->
queue);
1976 unsigned long flags;
1986 priv->
ops->tx_fill_cmd_descriptor(dev, entry, tcb_desc, skb);
1988 __skb_queue_tail(&ring->
queue, skb);
1989 spin_unlock_irqrestore(&priv->
irq_th_lock, flags);
1998 unsigned long flags;
2004 bool multi_addr =
false, broad_addr =
false, uni_addr =
false;
2007 u32 fwinfo_size = 0;
2011 " len=%d qidx=%d!!!\n", __func__, skb->
len,
2016 priv->
rtllib->bAwakePktSent =
true;
2024 pda_addr = header->
addr1;
2026 if (is_broadcast_ether_addr(pda_addr))
2028 else if (is_multicast_ether_addr(pda_addr))
2034 priv->
stats.txbytesunicast += skb->
len - fwinfo_size;
2035 else if (multi_addr)
2036 priv->
stats.txbytesmulticast += skb->
len - fwinfo_size;
2038 priv->
stats.txbytesbroadcast += skb->
len - fwinfo_size;
2047 pdesc = &ring->
desc[idx];
2050 "%d, skblen = 0x%x queuelen=%d",
2052 skb_queue_len(&ring->
queue));
2053 spin_unlock_irqrestore(&priv->
irq_th_lock, flags);
2058 if (priv->
rtllib->LedControlHandler)
2061 priv->
ops->tx_fill_descriptor(dev, pdesc, tcb_desc, skb);
2062 __skb_queue_tail(&ring->
queue, skb);
2064 spin_unlock_irqrestore(&priv->
irq_th_lock, flags);
2071 static short rtl8192_alloc_rx_desc_ring(
struct net_device *dev)
2075 int i, rx_queue_idx;
2077 for (rx_queue_idx = 0; rx_queue_idx <
MAX_RX_QUEUE; rx_queue_idx++) {
2079 sizeof(*priv->
rx_ring[rx_queue_idx]) *
2083 if (!priv->
rx_ring[rx_queue_idx] ||
2084 (
unsigned long)priv->
rx_ring[rx_queue_idx] & 0xFF) {
2090 sizeof(*priv->
rx_ring[rx_queue_idx]) *
2092 priv->
rx_idx[rx_queue_idx] = 0;
2097 entry = &priv->
rx_ring[rx_queue_idx][
i];
2103 *mapping = pci_map_single(priv->
pdev,
2120 static int rtl8192_alloc_tx_desc_ring(
struct net_device *dev,
2121 unsigned int prio,
unsigned int entries)
2129 if (!ring || (
unsigned long)ring & 0xFF) {
2135 memset(ring, 0,
sizeof(*ring)*entries);
2140 skb_queue_head_init(&priv->
tx_ring[prio].queue);
2157 ret = rtl8192_alloc_rx_desc_ring(dev);
2162 ret = rtl8192_alloc_tx_desc_ring(dev, i, priv->
txringcount);
2164 goto err_free_rings;
2170 rtl8192_free_rx_ring(dev);
2173 rtl8192_free_tx_ring(dev, i);
2180 int i, rx_queue_idx;
2181 unsigned long flags = 0;
2183 for (rx_queue_idx = 0; rx_queue_idx <
MAX_RX_QUEUE; rx_queue_idx++) {
2184 if (priv->
rx_ring[rx_queue_idx]) {
2187 entry = &priv->
rx_ring[rx_queue_idx][
i];
2190 priv->
rx_idx[rx_queue_idx] = 0;
2199 while (skb_queue_len(&ring->
queue)) {
2202 __skb_dequeue(&ring->
queue);
2204 pci_unmap_single(priv->
pdev,
2213 spin_unlock_irqrestore(&priv->
irq_th_lock, flags);
2231 signal_power = (
long)((signal_strength_index + 1) >> 1);
2234 return signal_power;
2247 if (priv->
stats.recv_signal_power == 0)
2248 priv->
stats.recv_signal_power =
2254 priv->
stats.recv_signal_power)
2256 priv->
stats.recv_signal_power = (priv->
stats.recv_signal_power * 5 +
2269 if ((antpower <= -100) || (antpower >= 20))
2271 else if (antpower >= 0)
2274 return 100 + antpower;
2291 ret_val = 0 - ret_val;
2310 static void rtl8192_rx_normal(
struct net_device *dev)
2314 bool unicast_packet =
false;
2315 bool bLedBlinking =
true;
2332 [priv->
rx_idx[rx_queue_idx]];
2334 [priv->
rx_idx[rx_queue_idx]];
2341 if (!priv->
ops->rx_query_status_descriptor(dev, &stats,
2350 pci_unmap_single(priv->
pdev,
2360 if (!is_multicast_ether_addr(rtllib_hdr->
addr1)) {
2362 unicast_packet =
true;
2367 bLedBlinking =
false;
2370 if (priv->
rtllib->LedControlHandler)
2371 priv->
rtllib->LedControlHandler(dev,
2376 priv->
stats.rxdatacrcerr++;
2378 priv->
stats.rxmgmtcrcerr++;
2388 priv->
stats.rxbytesunicast += skb_len;
2394 priv->
rx_buf[rx_queue_idx][priv->
rx_idx[rx_queue_idx]] =
2408 priv->
rx_idx[rx_queue_idx] = (priv->
rx_idx[rx_queue_idx] + 1) %
2419 static void rtl8192_tx_resume(
struct net_device *dev)
2428 while ((!skb_queue_empty(&ieee->
skb_waitQ[queue_index])) &&
2429 (priv->
rtllib->check_nic_enough_desc(dev, queue_index) > 0)) {
2438 rtl8192_tx_resume(priv->
rtllib->dev);
2443 rtl8192_rx_normal(priv->
rtllib->dev);
2445 if (MAX_RX_QUEUE > 1)
2466 if (_rtl8192_sta_up(dev, is_silent_reset) == -1)
2517 if (rtl8192_sta_down(dev, shutdownrf) == -1)
2531 priv->
ops->stop_adapter(dev,
true);
2548 static void r8192_set_multicast(
struct net_device *dev)
2582 u8 broadcast_addr[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
2583 u8 zero_addr[6] = {0};
2608 if (ipw->
u.
crypt.set_tx) {
2614 if (ipw->
u.
crypt.key_len == 13)
2617 else if (ipw->
u.
crypt.key_len == 5)
2651 && ieee->
pHTInfo->bCurrentHTSupport) {
2662 if (ipw->
u.
crypt.key_len == 13)
2665 else if (ipw->
u.
crypt.key_len == 5)
2675 broadcast_addr, 0, key, 0);
2679 broadcast_addr, 0, key);
2704 unsigned long flags;
2714 priv->
ops->interrupt_recognized(dev, &inta, &intb);
2715 priv->
stats.shints++;
2718 spin_unlock_irqrestore(&priv->
irq_th_lock, flags);
2722 if (inta == 0xffff) {
2723 spin_unlock_irqrestore(&priv->
irq_th_lock, flags);
2729 if (!netif_running(dev)) {
2730 spin_unlock_irqrestore(&priv->
irq_th_lock, flags);
2736 priv->
stats.txbeaconokint++;
2741 priv->
stats.txbeaconerr++;
2749 priv->
stats.txmanageokint++;
2751 spin_unlock_irqrestore(&priv->
irq_th_lock, flags);
2752 if (priv->
rtllib->ack_tx_to_ieee) {
2754 priv->
rtllib->ack_tx_to_ieee = 0;
2762 priv->
stats.txcmdpktokint++;
2770 priv->
stats.rxint++;
2782 priv->
stats.rxrdu++;
2790 priv->
stats.rxoverflow++;
2795 priv->
stats.txoverflow++;
2799 priv->
stats.txbkokint++;
2800 priv->
rtllib->LinkDetectInfo.NumTxOkInPeriod++;
2806 priv->
stats.txbeokint++;
2807 priv->
rtllib->LinkDetectInfo.NumTxOkInPeriod++;
2813 priv->
stats.txviokint++;
2814 priv->
rtllib->LinkDetectInfo.NumTxOkInPeriod++;
2819 priv->
stats.txvookint++;
2821 priv->
rtllib->LinkDetectInfo.NumTxOkInPeriod++;
2825 spin_unlock_irqrestore(&priv->
irq_th_lock, flags);
2842 .ndo_set_rx_mode = r8192_set_multicast,
2852 unsigned long ioaddr = 0;
2856 unsigned long pmem_start, pmem_len, pmem_flags;
2858 bool bdma64 =
false;
2871 if (pci_set_consistent_dma_mask(pdev,
DMA_BIT_MASK(32))) {
2872 printk(
KERN_INFO "Unable to obtain 32bit DMA for consistent allocations\n");
2873 goto err_pci_disable;
2878 goto err_pci_disable;
2884 pci_set_drvdata(pdev, dev);
2886 priv = rtllib_priv(dev);
2892 priv->
rtllib->bSupportRemoteWakeUp = 1;
2894 priv->
rtllib->bSupportRemoteWakeUp = 0;
2902 goto err_rel_rtllib;
2908 goto err_rel_rtllib;
2913 if (ioaddr == (
unsigned long)
NULL) {
2921 pci_read_config_byte(pdev, 0x08, &revision_id);
2923 if (pdev->
device == 0x8192 && revision_id == 0x10)
2956 netif_stop_queue(dev);
2977 DMESG(
"wlan driver load failed\n");
2978 pci_set_drvdata(pdev,
NULL);
2986 struct net_device *dev = pci_get_drvdata(pdev);
2993 priv = rtllib_priv(dev);
3006 rtl8192_free_rx_ring(dev);
3008 rtl8192_free_tx_ring(dev, i);
3025 priv = rtllib_priv(dev);
3034 bool init_status =
true;
3037 (&(priv->
rtllib->PowerSaveControl));
3048 init_status = priv->
ops->initialize_adapter(dev);
3049 if (init_status !=
true) {
3071 tmp_state = priv->
rtllib->state;
3073 priv->
rtllib->state = tmp_state;
3077 priv->
ops->stop_adapter(dev,
false);
3083 static int __init rtl8192_pci_module_init(
void)
3089 if (0 != pci_register_driver(&rtl8192_pci_driver)) {
3090 DMESG(
"No device found");
3097 static void __exit rtl8192_pci_module_exit(
void)
3136 MODULE_PARM_DESC(hwwep,
" Try to use hardware WEP support(default use hw. set 0 to use software security)");