36 #include <linux/export.h>
46 static const u8 ac_to_hwq[] = {
60 if (
unlikely(ieee80211_is_beacon(fc)))
62 if (ieee80211_is_mgmt(fc))
65 if (ieee80211_is_nullfunc(fc))
72 static void _rtl_pci_update_default_setting(
struct ieee80211_hw *hw)
174 "switch case not processed\n");
180 pci_read_config_byte(rtlpci->
pdev, 0x80, &init_aspm);
186 static bool _rtl_pci_platform_switch_device_pci_aspm(
196 pci_write_config_byte(rtlpci->
pdev, 0x80, value);
202 static void _rtl_pci_switch_clk_req(
struct ieee80211_hw *hw,
u8 value)
207 pci_write_config_byte(rtlpci->
pdev, 0x81, value);
214 static void rtl_pci_disable_aspm(
struct ieee80211_hw *hw)
225 pcibridge_linkctrlreg;
234 "PCI(Bridge) UNKNOWN\n");
241 _rtl_pci_switch_clk_req(hw, 0x0);
245 pci_read_config_byte(rtlpci->
pdev, 0x80, &tmp_u1b);
248 aspmlevel |=
BIT(0) |
BIT(1);
249 linkctrl_reg &= ~aspmlevel;
250 pcibridge_linkctrlreg &= ~(
BIT(0) |
BIT(1));
252 _rtl_pci_platform_switch_device_pci_aspm(hw, linkctrl_reg);
256 pci_write_config_byte(rtlpci->
pdev, (num4bytes << 2),
257 pcibridge_linkctrlreg);
268 static void rtl_pci_enable_aspm(
struct ieee80211_hw *hw)
280 u8 u_pcibridge_aspmsetting;
281 u8 u_device_aspmsetting;
288 "PCI(Bridge) UNKNOWN\n");
294 u_pcibridge_aspmsetting =
299 u_pcibridge_aspmsetting &= ~
BIT(0);
301 pci_write_config_byte(rtlpci->
pdev, (num4bytes << 2),
302 u_pcibridge_aspmsetting);
305 "PlatformEnableASPM():PciBridge busnumber[%x], DevNumbe[%x], funcnumber[%x], Write reg[%x] = %x\n",
306 pcibridge_busnum, pcibridge_devnum, pcibridge_funcnum,
307 (pcipriv->
ndis_adapter.pcibridge_pciehdr_offset + 0x10),
308 u_pcibridge_aspmsetting);
314 u_device_aspmsetting = pcipriv->
ndis_adapter.linkctrl_reg;
319 u_device_aspmsetting |= aspmlevel;
321 _rtl_pci_platform_switch_device_pci_aspm(hw, u_device_aspmsetting);
331 static bool rtl_pci_get_amd_l1_patch(
struct ieee80211_hw *hw)
339 pci_write_config_byte(rtlpci->
pdev, 0xe0, 0xa0);
341 pci_read_config_byte(rtlpci->
pdev, 0xe0, &offset_e0);
343 if (offset_e0 == 0xA0) {
344 pci_read_config_dword(rtlpci->
pdev, 0xe4, &offset_e4);
345 if (offset_e4 &
BIT(23))
352 static void rtl_pci_get_linkcontrol_field(
struct ieee80211_hw *hw)
356 u8 capabilityoffset = pcipriv->
ndis_adapter.pcibridge_pciehdr_offset;
360 num4bbytes = (capabilityoffset + 0x10) / 4;
363 pci_read_config_byte(rtlpci->
pdev, (num4bbytes << 2), &linkctrl_reg);
365 pcipriv->
ndis_adapter.pcibridge_linkctrlreg = linkctrl_reg;
368 static void rtl_pci_parse_configuration(
struct pci_dev *
pdev,
384 pci_read_config_byte(pdev, 0x98, &tmp);
386 pci_write_config_byte(pdev, 0x98, tmp);
389 pci_write_config_byte(pdev, 0x70f, tmp);
396 _rtl_pci_update_default_setting(hw);
400 rtl_pci_enable_aspm(hw);
406 static void _rtl_pci_io_handler_init(
struct device *
dev,
411 rtlpriv->
io.dev =
dev;
413 rtlpriv->
io.write8_async = pci_write8_async;
414 rtlpriv->
io.write16_async = pci_write16_async;
415 rtlpriv->
io.write32_async = pci_write32_async;
417 rtlpriv->
io.read8_sync = pci_read8_sync;
418 rtlpriv->
io.read16_sync = pci_read16_sync;
419 rtlpriv->
io.read32_sync = pci_read32_sync;
423 static void _rtl_pci_io_handler_release(
struct ieee80211_hw *hw)
427 static bool _rtl_update_earlymode_info(
struct ieee80211_hw *hw,
437 additionlen += info->
control.hw_key->icv_len;
441 spin_lock_bh(&rtlpriv->
locks.waitq_lock);
442 skb_queue_walk(&rtlpriv->
mac80211.skb_waitq[tid], next_skb) {
445 next_info = IEEE80211_SKB_CB(next_skb);
448 next_skb->
len + additionlen;
454 if (skb_queue_is_last(&rtlpriv->
mac80211.skb_waitq[tid],
461 spin_unlock_bh(&rtlpriv->
locks.waitq_lock);
467 static void _rtl_pci_tx_chk_waitq(
struct ieee80211_hw *hw)
476 if (!rtlpriv->
rtlhal.earlymode_enable)
480 for (tid = 7; tid >= 0; tid--) {
484 rtlpriv->
psc.rfpwr_state ==
ERFON) {
488 spin_lock_bh(&rtlpriv->
locks.waitq_lock);
489 if (!skb_queue_empty(&mac->
skb_waitq[tid]) &&
493 spin_unlock_bh(&rtlpriv->
locks.waitq_lock);
496 spin_unlock_bh(&rtlpriv->
locks.waitq_lock);
500 info = IEEE80211_SKB_CB(skb);
502 _rtl_update_earlymode_info(hw, skb,
505 rtlpriv->
intf_ops->adapter_tx(hw,
NULL, skb, &tcb_desc);
518 while (skb_queue_len(&ring->
queue)) {
525 u8 own = (
u8) rtlpriv->
cfg->ops->get_desc((
u8 *) entry,
true,
537 skb = __skb_dequeue(&ring->
queue);
538 pci_unmap_single(rtlpci->
pdev,
540 get_desc((
u8 *) entry,
true,
545 if (rtlpriv->
rtlhal.earlymode_enable)
549 "new ring->idx:%d, free: skb_queue_len:%d, free: seq:%x\n",
551 skb_queue_len(&ring->
queue),
563 fc = rtl_get_fc(skb);
564 if (ieee80211_is_nullfunc(fc)) {
565 if (ieee80211_has_pm(fc)) {
566 rtlpriv->
mac80211.offchan_delay =
true;
567 rtlpriv->
psc.state_inap =
true;
569 rtlpriv->
psc.state_inap =
false;
574 tid = rtl_get_tid(skb);
576 rtlpriv->
link_info.tidtx_inperiod[tid]++;
578 info = IEEE80211_SKB_CB(skb);
579 ieee80211_tx_info_clear_status(info);
590 "more desc left, wake skb_queue@%d, ring->idx = %d, skb_queue_len = 0x%d\n",
592 skb_queue_len(&ring->
queue));
595 skb_get_queue_mapping
602 if (((rtlpriv->
link_info.num_rx_inperiod +
603 rtlpriv->
link_info.num_tx_inperiod) > 8) ||
604 (rtlpriv->
link_info.num_rx_inperiod > 2)) {
614 __le16 fc = rtl_get_fc(skb);
615 bool unicast =
false;
620 memcpy(IEEE80211_SKB_RXCB(skb), &rx_status,
sizeof(rx_status));
622 if (is_broadcast_ether_addr(hdr->
addr1)) {
624 }
else if (is_multicast_ether_addr(hdr->
addr1)) {
628 rtlpriv->
stats.rxbytesunicast += skb->
len;
633 if (ieee80211_is_data(fc)) {
645 (ieee80211_is_beacon(fc) || ieee80211_is_probe_resp(fc)))
651 uskb = dev_alloc_skb(skb->
len + 128);
654 memcpy(IEEE80211_SKB_RXCB(uskb), &rx_status,
sizeof(rx_status));
661 static void _rtl_pci_rx_interrupt(
struct ieee80211_hw *hw)
690 own = (
u8) rtlpriv->
cfg->ops->get_desc((
u8 *) pdesc,
697 rtlpriv->
cfg->ops->query_rx_desc(hw, &stats,
707 "can't alloc skb for rx\n");
711 pci_unmap_single(rtlpci->
pdev,
716 skb_put(skb, rtlpriv->
cfg->ops->get_desc((
u8 *) pdesc,
false,
727 _rtl_receive_one(hw, skb, rx_status);
729 if (((rtlpriv->
link_info.num_rx_inperiod +
730 rtlpriv->
link_info.num_tx_inperiod) > 8) ||
731 (rtlpriv->
link_info.num_rx_inperiod > 2)) {
740 pci_map_single(rtlpci->
pdev, skb_tail_pointer(skb),
747 rtlpriv->
cfg->ops->set_desc((
u8 *) pdesc,
false,
749 (
u8 *)&bufferaddress);
750 rtlpriv->
cfg->ops->set_desc((
u8 *)pdesc,
false,
755 rtlpriv->
cfg->ops->set_desc((
u8 *)pdesc,
false,
781 rtlpriv->
cfg->ops->interrupt_recognized(hw, &inta, &intb);
784 if (!inta || inta == 0xffff) {
792 "beacon ok interrupt!\n");
797 "beacon err interrupt!\n");
806 "prepare beacon for interrupt!\n");
807 tasklet_schedule(&rtlpriv->
works.irq_prepare_bcn_tasklet);
816 "Manage ok interrupt!\n");
822 "HIGH_QUEUE ok interrupt!\n");
830 "BK Tx OK interrupt!\n");
838 "BE TX OK interrupt!\n");
846 "VI TX OK interrupt!\n");
854 "Vo TX OK interrupt!\n");
863 "CMD TX OK interrupt!\n");
871 _rtl_pci_rx_interrupt(hw);
876 "rx descriptor unavailable!\n");
877 _rtl_pci_rx_interrupt(hw);
882 _rtl_pci_rx_interrupt(hw);
885 if (rtlpriv->
rtlhal.earlymode_enable)
886 tasklet_schedule(&rtlpriv->
works.irq_tasklet);
889 spin_unlock_irqrestore(&rtlpriv->
locks.irq_th_lock, flags);
893 static void _rtl_pci_irq_tasklet(
struct ieee80211_hw *hw)
895 _rtl_pci_tx_chk_waitq(hw);
898 static void _rtl_pci_prepare_bcn_tasklet(
struct ieee80211_hw *hw)
913 pskb = __skb_dequeue(&ring->
queue);
916 pci_unmap_single(rtlpci->
pdev, rtlpriv->
cfg->ops->get_desc(
923 pskb = ieee80211_beacon_get(hw, mac->
vif);
926 hdr = rtl_get_hdr(pskb);
927 info = IEEE80211_SKB_CB(pskb);
928 pdesc = &ring->
desc[0];
929 rtlpriv->
cfg->ops->fill_tx_desc(hw, hdr, (
u8 *) pdesc,
932 __skb_queue_tail(&ring->
queue, pskb);
949 static void _rtl_pci_init_trx_var(
struct ieee80211_hw *hw)
974 static void _rtl_pci_init_struct(
struct ieee80211_hw *hw,
989 _rtl_pci_init_trx_var(hw);
1005 (
void (*)(
unsigned long))_rtl_pci_irq_tasklet,
1008 (
void (*)(
unsigned long))_rtl_pci_prepare_bcn_tasklet,
1010 INIT_WORK(&rtlpriv->
works.lps_leave_work, rtl_lps_leave_work_callback);
1013 static int _rtl_pci_init_tx_ring(
struct ieee80211_hw *hw,
1014 unsigned int prio,
unsigned int entries)
1020 u32 nextdescaddress;
1024 sizeof(*ring) * entries, &dma);
1026 if (!ring || (
unsigned long)ring & 0xFF) {
1028 "Cannot allocate TX ring (prio = %d)\n", prio);
1032 memset(ring, 0,
sizeof(*ring) * entries);
1037 skb_queue_head_init(&rtlpci->
tx_ring[prio].queue);
1042 for (i = 0; i <
entries; i++) {
1043 nextdescaddress = (
u32) dma +
1047 rtlpriv->
cfg->ops->set_desc((
u8 *)&(ring[i]),
1049 (
u8 *)&nextdescaddress);
1055 static int _rtl_pci_init_rx_ring(
struct ieee80211_hw *hw)
1060 int i, rx_queue_idx;
1069 rtlpci->
rx_ring[rx_queue_idx].desc =
1071 sizeof(*rtlpci->
rx_ring[rx_queue_idx].
1073 &rtlpci->
rx_ring[rx_queue_idx].dma);
1075 if (!rtlpci->
rx_ring[rx_queue_idx].desc ||
1076 (
unsigned long)rtlpci->
rx_ring[rx_queue_idx].desc & 0xFF) {
1078 "Cannot allocate RX ring\n");
1083 sizeof(*rtlpci->
rx_ring[rx_queue_idx].desc) *
1086 rtlpci->
rx_ring[rx_queue_idx].idx = 0;
1092 rtlpriv->
rtlhal.disable_amsdu_8k)
1102 entry = &rtlpci->
rx_ring[rx_queue_idx].desc[
i];
1113 pci_map_single(rtlpci->
pdev, skb_tail_pointer(skb),
1118 rtlpriv->
cfg->ops->set_desc((
u8 *)entry,
false,
1120 (
u8 *)&bufferaddress);
1121 rtlpriv->
cfg->ops->set_desc((
u8 *)entry,
false,
1125 rtlpriv->
cfg->ops->set_desc((
u8 *) entry,
false,
1130 rtlpriv->
cfg->ops->set_desc((
u8 *) entry,
false,
1136 static void _rtl_pci_free_tx_ring(
struct ieee80211_hw *hw,
1143 while (skb_queue_len(&ring->
queue)) {
1147 pci_unmap_single(rtlpci->
pdev,
1149 ops->get_desc((
u8 *) entry,
true,
1164 static void _rtl_pci_free_rx_ring(
struct rtl_pci *rtlpci)
1166 int i, rx_queue_idx;
1174 rtlpci->
rx_ring[rx_queue_idx].rx_buf[
i];
1178 pci_unmap_single(rtlpci->
pdev,
1185 if (rtlpci->
rx_ring[rx_queue_idx].desc) {
1187 sizeof(*rtlpci->
rx_ring[rx_queue_idx].
1189 rtlpci->
rx_ring[rx_queue_idx].desc,
1190 rtlpci->
rx_ring[rx_queue_idx].dma);
1196 static int _rtl_pci_init_trx_ring(
struct ieee80211_hw *hw)
1202 ret = _rtl_pci_init_rx_ring(hw);
1207 ret = _rtl_pci_init_tx_ring(hw, i,
1210 goto err_free_rings;
1216 _rtl_pci_free_rx_ring(rtlpci);
1220 _rtl_pci_free_tx_ring(hw, i);
1225 static int _rtl_pci_deinit_trx_ring(
struct ieee80211_hw *hw)
1231 _rtl_pci_free_rx_ring(rtlpci);
1235 _rtl_pci_free_tx_ring(hw, i);
1244 int i, rx_queue_idx;
1245 unsigned long flags;
1256 if (rtlpci->
rx_ring[rx_queue_idx].desc) {
1260 entry = &rtlpci->
rx_ring[rx_queue_idx].desc[
i];
1261 rtlpriv->
cfg->ops->set_desc((
u8 *) entry,
1266 rtlpci->
rx_ring[rx_queue_idx].idx = 0;
1275 if (rtlpci->
tx_ring[i].desc) {
1278 while (skb_queue_len(&ring->
queue)) {
1284 entry = &ring->
desc[ring->
idx];
1285 skb = __skb_dequeue(&ring->
queue);
1286 pci_unmap_single(rtlpci->
pdev,
1294 spin_unlock_irqrestore(&rtlpriv->
locks.irq_th_lock,
1305 static bool rtl_pci_tx_chk_waitq_insert(
struct ieee80211_hw *hw,
1311 u8 tid = rtl_get_tid(skb);
1317 if (!rtlpriv->
rtlhal.earlymode_enable)
1321 if (_rtl_mac_to_hwqueue(hw, skb) >
VO_QUEUE)
1327 if (!rtlpriv->
link_info.higher_busytxtraffic[tid])
1330 spin_lock_bh(&rtlpriv->
locks.waitq_lock);
1332 spin_unlock_bh(&rtlpriv->
locks.waitq_lock);
1348 u8 hw_queue = _rtl_mac_to_hwqueue(hw, skb);
1349 unsigned long flags;
1351 __le16 fc = rtl_get_fc(skb);
1360 if (ieee80211_is_auth(fc)) {
1365 if (rtlpriv->
psc.sw_ps_enabled) {
1366 if (ieee80211_is_data(fc) && !ieee80211_is_nullfunc(fc) &&
1367 !ieee80211_has_pm(fc))
1373 if (is_multicast_ether_addr(pda_addr))
1374 rtlpriv->
stats.txbytesmulticast += skb->
len;
1375 else if (is_broadcast_ether_addr(pda_addr))
1376 rtlpriv->
stats.txbytesbroadcast += skb->
len;
1378 rtlpriv->
stats.txbytesunicast += skb->
len;
1381 ring = &rtlpci->
tx_ring[hw_queue];
1383 idx = (ring->
idx + skb_queue_len(&ring->
queue)) %
1388 pdesc = &ring->
desc[idx];
1389 own = (
u8) rtlpriv->
cfg->ops->get_desc((
u8 *) pdesc,
1394 "No more TX desc@%d, ring->idx = %d, idx = %d, skb_queue_len = 0x%d\n",
1395 hw_queue, ring->
idx, idx,
1396 skb_queue_len(&ring->
queue));
1398 spin_unlock_irqrestore(&rtlpriv->
locks.irq_th_lock, flags);
1402 if (ieee80211_is_data_qos(fc)) {
1403 tid = rtl_get_tid(skb);
1411 sta_entry->
tids[tid].seq_number = seq_number;
1415 if (ieee80211_is_data(fc))
1418 rtlpriv->
cfg->ops->fill_tx_desc(hw, hdr, (
u8 *)pdesc,
1419 info, sta, skb, hw_queue, ptcb_desc);
1421 __skb_queue_tail(&ring->
queue, skb);
1423 rtlpriv->
cfg->ops->set_desc((
u8 *)pdesc,
true,
1427 if ((ring->
entries - skb_queue_len(&ring->
queue)) < 2 &&
1431 "less desc left, stop skb_queue@%d, ring->idx = %d, idx = %d, skb_queue_len = 0x%d\n",
1432 hw_queue, ring->
idx, idx,
1433 skb_queue_len(&ring->
queue));
1438 spin_unlock_irqrestore(&rtlpriv->
locks.irq_th_lock, flags);
1440 rtlpriv->
cfg->ops->tx_polling(hw, hw_queue);
1445 static void rtl_pci_flush(
struct ieee80211_hw *hw,
bool drop)
1454 for (queue_id = RTL_PCI_MAX_TX_QUEUE_COUNT - 1; queue_id >= 0;) {
1456 ring = &pcipriv->
dev.tx_ring[queue_id];
1457 queue_len = skb_queue_len(&ring->
queue);
1468 if (rtlpriv->
psc.rfpwr_state ==
ERFOFF ||
1469 is_hal_stop(rtlhal) || i >= 200)
1479 _rtl_pci_deinit_trx_ring(hw);
1495 _rtl_pci_init_struct(hw, pdev);
1497 err = _rtl_pci_init_trx_ring(hw);
1500 "tx ring initialization failed\n");
1519 err = rtlpriv->
cfg->ops->hw_init(hw);
1522 "Failed to config hardware!\n");
1526 rtlpriv->
cfg->ops->enable_interrupt(hw);
1532 set_hal_start(rtlhal);
1548 unsigned long flags;
1549 u8 RFInProgressTimeOut = 0;
1555 set_hal_stop(rtlhal);
1557 rtlpriv->
cfg->ops->disable_interrupt(hw);
1562 spin_unlock_irqrestore(&rtlpriv->
locks.rf_ps_lock, flags);
1563 if (RFInProgressTimeOut > 100) {
1568 RFInProgressTimeOut++;
1572 spin_unlock_irqrestore(&rtlpriv->
locks.rf_ps_lock, flags);
1575 rtlpriv->
cfg->ops->hw_disable(hw);
1583 spin_unlock_irqrestore(&rtlpriv->
locks.rf_ps_lock, flags);
1585 rtl_pci_enable_aspm(hw);
1588 static bool _rtl_pci_find_adapter(
struct pci_dev *pdev,
1594 struct pci_dev *bridge_pdev = pdev->
bus->self;
1604 pci_read_config_byte(pdev, 0x8, &revisionid);
1605 pci_read_config_word(pdev, 0x3C, &irqline);
1625 switch (revisionid) {
1628 "8192 PCI-E is found - vid/did=%x/%x\n",
1629 venderid, deviceid);
1634 "8192SE is found - vid/did=%x/%x\n",
1635 venderid, deviceid);
1640 "Err: Unknown device - vid/did=%x/%x\n",
1641 venderid, deviceid);
1652 "8192C PCI-E is found - vid/did=%x/%x\n",
1653 venderid, deviceid);
1658 "8192D PCI-E is found - vid/did=%x/%x\n",
1659 venderid, deviceid);
1662 "Err: Unknown device - vid/did=%x/%x\n",
1663 venderid, deviceid);
1669 if (revisionid == 0 || revisionid == 1) {
1670 if (revisionid == 0) {
1672 "Find 92DE MAC0\n");
1674 }
else if (revisionid == 1) {
1676 "Find 92DE MAC1\n");
1681 "Unknown device - VendorID/DeviceID=%x/%x, Revision=%x\n",
1682 venderid, deviceid, revisionid);
1695 if (bridge_pdev->
vendor == pcibridge_vendors[tmp]) {
1698 "Pci Bridge Vendor is found index: %d\n",
1708 bridge_pdev->
bus->number;
1714 pci_pcie_cap(bridge_pdev);
1716 (pcipriv->
ndis_adapter.pcibridge_pciehdr_offset + 0x10) / 4;
1718 rtl_pci_get_linkcontrol_field(hw);
1723 rtl_pci_get_amd_l1_patch(hw);
1728 "pcidev busnumber:devnumber:funcnumber:vendor:link_ctl %d:%d:%d:%x:%x\n",
1735 "pci_bridge busnumber:devnumber:funcnumber:vendor:pcie_cap:link_ctl_reg:amd %d:%d:%d:%x:%x:%x:%x\n",
1739 pcibridge_vendors[pcipriv->
ndis_adapter.pcibridge_vendor],
1744 rtl_pci_parse_configuration(pdev, hw);
1757 unsigned long pmem_start, pmem_len, pmem_flags;
1762 RT_ASSERT(
false,
"%s : Cannot enable new PCI device\n",
1768 if (pci_set_consistent_dma_mask(pdev,
DMA_BIT_MASK(32))) {
1770 "Unable to obtain 32bit DMA for consistent allocations\n");
1782 "%s : ieee80211 alloc failed\n", pci_name(pdev));
1787 SET_IEEE80211_DEV(hw, &pdev->
dev);
1788 pci_set_drvdata(pdev, hw);
1791 pcipriv = (
void *)rtlpriv->
priv;
1792 pcipriv->
dev.pdev = pdev;
1813 RT_ASSERT(
false,
"Can't obtain PCI resources\n");
1822 rtlpriv->
io.pci_mem_start =
1823 (
unsigned long)pci_iomap(pdev,
1824 rtlpriv->
cfg->bar_id, pmem_len);
1825 if (rtlpriv->
io.pci_mem_start == 0) {
1826 RT_ASSERT(
false,
"Can't map PCI mem\n");
1832 "mem mapped space: start: 0x%08lx len:%08lx flags:%08lx, after map:0x%08lx\n",
1833 pmem_start, pmem_len, pmem_flags,
1834 rtlpriv->
io.pci_mem_start);
1837 pci_write_config_byte(pdev, 0x81, 0);
1839 pci_write_config_byte(pdev, 0x44, 0);
1840 pci_write_config_byte(pdev, 0x04, 0x06);
1841 pci_write_config_byte(pdev, 0x04, 0x07);
1844 if (!_rtl_pci_find_adapter(pdev, hw)) {
1850 _rtl_pci_io_handler_init(&pdev->
dev, hw);
1853 rtlpriv->
cfg->ops->read_eeprom_info(hw);
1856 rtl_pci_init_aspm(hw);
1862 "Can't allocate sw for mac80211\n");
1867 err = rtl_pci_init(hw, pdev);
1873 if (rtlpriv->
cfg->ops->init_sw_vars(hw)) {
1879 rtlpriv->
cfg->ops->init_sw_leds(hw);
1884 "failed to create sysfs device attributes\n");
1893 "%s: failed to register IRQ handler\n",
1894 wiphy_name(hw->
wiphy));
1903 _rtl_pci_io_handler_release(hw);
1905 if (rtlpriv->
io.pci_mem_start != 0)
1915 pci_set_drvdata(pdev,
NULL);
1943 rtlpriv->
intf_ops->adapter_stop(hw);
1945 rtlpriv->
cfg->ops->disable_interrupt(hw);
1952 _rtl_pci_io_handler_release(hw);
1953 rtlpriv->
cfg->ops->deinit_sw_vars(hw);
1960 if (rtlpriv->
io.pci_mem_start != 0) {
1967 rtl_pci_disable_aspm(hw);
1969 pci_set_drvdata(pdev,
NULL);
1996 rtlpriv->
cfg->ops->hw_suspend(hw);
2009 rtlpriv->
cfg->ops->hw_resume(hw);
2017 .adapter_start = rtl_pci_start,
2018 .adapter_stop = rtl_pci_stop,
2019 .adapter_tx = rtl_pci_tx,
2020 .flush = rtl_pci_flush,
2022 .waitq_insert = rtl_pci_tx_chk_waitq_insert,
2024 .disable_aspm = rtl_pci_disable_aspm,
2025 .enable_aspm = rtl_pci_enable_aspm,