diff options
author | David S. Miller <davem@davemloft.net> | 2011-05-05 17:09:28 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-05-05 17:09:28 -0400 |
commit | 90864fbc7639d7a2300c67a18c9fb9fbcf7d51d2 (patch) | |
tree | 6951c8d0e529dbfc7c4cec75d4cec63350e39b7c /drivers/net/wireless/rtlwifi/pci.c | |
parent | 228e548e602061b08ee8e8966f567c12aa079682 (diff) | |
parent | a70171dce9cd44cb06c7d299eba9fa87a8933045 (diff) |
Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Diffstat (limited to 'drivers/net/wireless/rtlwifi/pci.c')
-rw-r--r-- | drivers/net/wireless/rtlwifi/pci.c | 626 |
1 files changed, 409 insertions, 217 deletions
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c index c3dd4cc678ba..3550c9fb96e5 100644 --- a/drivers/net/wireless/rtlwifi/pci.c +++ b/drivers/net/wireless/rtlwifi/pci.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include "pci.h" | 32 | #include "pci.h" |
33 | #include "base.h" | 33 | #include "base.h" |
34 | #include "ps.h" | 34 | #include "ps.h" |
35 | #include "efuse.h" | ||
35 | 36 | ||
36 | static const u16 pcibridge_vendors[PCI_BRIDGE_VENDOR_MAX] = { | 37 | static const u16 pcibridge_vendors[PCI_BRIDGE_VENDOR_MAX] = { |
37 | INTEL_VENDOR_ID, | 38 | INTEL_VENDOR_ID, |
@@ -40,6 +41,31 @@ static const u16 pcibridge_vendors[PCI_BRIDGE_VENDOR_MAX] = { | |||
40 | SIS_VENDOR_ID | 41 | SIS_VENDOR_ID |
41 | }; | 42 | }; |
42 | 43 | ||
44 | static const u8 ac_to_hwq[] = { | ||
45 | VO_QUEUE, | ||
46 | VI_QUEUE, | ||
47 | BE_QUEUE, | ||
48 | BK_QUEUE | ||
49 | }; | ||
50 | |||
51 | static u8 _rtl_mac_to_hwqueue(struct ieee80211_hw *hw, | ||
52 | struct sk_buff *skb) | ||
53 | { | ||
54 | struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); | ||
55 | __le16 fc = rtl_get_fc(skb); | ||
56 | u8 queue_index = skb_get_queue_mapping(skb); | ||
57 | |||
58 | if (unlikely(ieee80211_is_beacon(fc))) | ||
59 | return BEACON_QUEUE; | ||
60 | if (ieee80211_is_mgmt(fc)) | ||
61 | return MGNT_QUEUE; | ||
62 | if (rtlhal->hw_type == HARDWARE_TYPE_RTL8192SE) | ||
63 | if (ieee80211_is_nullfunc(fc)) | ||
64 | return HIGH_QUEUE; | ||
65 | |||
66 | return ac_to_hwq[queue_index]; | ||
67 | } | ||
68 | |||
43 | /* Update PCI dependent default settings*/ | 69 | /* Update PCI dependent default settings*/ |
44 | static void _rtl_pci_update_default_setting(struct ieee80211_hw *hw) | 70 | static void _rtl_pci_update_default_setting(struct ieee80211_hw *hw) |
45 | { | 71 | { |
@@ -48,6 +74,7 @@ static void _rtl_pci_update_default_setting(struct ieee80211_hw *hw) | |||
48 | struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); | 74 | struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); |
49 | struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); | 75 | struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); |
50 | u8 pcibridge_vendor = pcipriv->ndis_adapter.pcibridge_vendor; | 76 | u8 pcibridge_vendor = pcipriv->ndis_adapter.pcibridge_vendor; |
77 | u8 init_aspm; | ||
51 | 78 | ||
52 | ppsc->reg_rfps_level = 0; | 79 | ppsc->reg_rfps_level = 0; |
53 | ppsc->support_aspm = 0; | 80 | ppsc->support_aspm = 0; |
@@ -113,25 +140,45 @@ static void _rtl_pci_update_default_setting(struct ieee80211_hw *hw) | |||
113 | 140 | ||
114 | /*Set HW definition to determine if it supports ASPM. */ | 141 | /*Set HW definition to determine if it supports ASPM. */ |
115 | switch (rtlpci->const_support_pciaspm) { | 142 | switch (rtlpci->const_support_pciaspm) { |
116 | case 0: | 143 | case 0:{ |
117 | /*Not support ASPM. */ | 144 | /*Not support ASPM. */ |
118 | ppsc->support_aspm = false; | 145 | bool support_aspm = false; |
119 | break; | 146 | ppsc->support_aspm = support_aspm; |
120 | case 1: | 147 | break; |
121 | /*Support ASPM. */ | 148 | } |
122 | ppsc->support_aspm = true; | 149 | case 1:{ |
123 | ppsc->support_backdoor = true; | 150 | /*Support ASPM. */ |
124 | break; | 151 | bool support_aspm = true; |
152 | bool support_backdoor = true; | ||
153 | ppsc->support_aspm = support_aspm; | ||
154 | |||
155 | /*if (priv->oem_id == RT_CID_TOSHIBA && | ||
156 | !priv->ndis_adapter.amd_l1_patch) | ||
157 | support_backdoor = false; */ | ||
158 | |||
159 | ppsc->support_backdoor = support_backdoor; | ||
160 | |||
161 | break; | ||
162 | } | ||
125 | case 2: | 163 | case 2: |
126 | /*ASPM value set by chipset. */ | 164 | /*ASPM value set by chipset. */ |
127 | if (pcibridge_vendor == PCI_BRIDGE_VENDOR_INTEL) | 165 | if (pcibridge_vendor == PCI_BRIDGE_VENDOR_INTEL) { |
128 | ppsc->support_aspm = true; | 166 | bool support_aspm = true; |
167 | ppsc->support_aspm = support_aspm; | ||
168 | } | ||
129 | break; | 169 | break; |
130 | default: | 170 | default: |
131 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | 171 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, |
132 | ("switch case not process\n")); | 172 | ("switch case not process\n")); |
133 | break; | 173 | break; |
134 | } | 174 | } |
175 | |||
176 | /* toshiba aspm issue, toshiba will set aspm selfly | ||
177 | * so we should not set aspm in driver */ | ||
178 | pci_read_config_byte(rtlpci->pdev, 0x80, &init_aspm); | ||
179 | if (rtlpriv->rtlhal.hw_type == HARDWARE_TYPE_RTL8192SE && | ||
180 | init_aspm == 0x43) | ||
181 | ppsc->support_aspm = false; | ||
135 | } | 182 | } |
136 | 183 | ||
137 | static bool _rtl_pci_platform_switch_device_pci_aspm( | 184 | static bool _rtl_pci_platform_switch_device_pci_aspm( |
@@ -139,8 +186,11 @@ static bool _rtl_pci_platform_switch_device_pci_aspm( | |||
139 | u8 value) | 186 | u8 value) |
140 | { | 187 | { |
141 | struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); | 188 | struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); |
189 | struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); | ||
190 | |||
191 | if (rtlhal->hw_type != HARDWARE_TYPE_RTL8192SE) | ||
192 | value |= 0x40; | ||
142 | 193 | ||
143 | value |= 0x40; | ||
144 | pci_write_config_byte(rtlpci->pdev, 0x80, value); | 194 | pci_write_config_byte(rtlpci->pdev, 0x80, value); |
145 | 195 | ||
146 | return false; | 196 | return false; |
@@ -150,11 +200,13 @@ static bool _rtl_pci_platform_switch_device_pci_aspm( | |||
150 | static bool _rtl_pci_switch_clk_req(struct ieee80211_hw *hw, u8 value) | 200 | static bool _rtl_pci_switch_clk_req(struct ieee80211_hw *hw, u8 value) |
151 | { | 201 | { |
152 | struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); | 202 | struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); |
153 | u8 buffer; | 203 | struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); |
154 | 204 | ||
155 | buffer = value; | ||
156 | pci_write_config_byte(rtlpci->pdev, 0x81, value); | 205 | pci_write_config_byte(rtlpci->pdev, 0x81, value); |
157 | 206 | ||
207 | if (rtlhal->hw_type == HARDWARE_TYPE_RTL8192SE) | ||
208 | udelay(100); | ||
209 | |||
158 | return true; | 210 | return true; |
159 | } | 211 | } |
160 | 212 | ||
@@ -175,6 +227,9 @@ static void rtl_pci_disable_aspm(struct ieee80211_hw *hw) | |||
175 | u16 aspmlevel = 0; | 227 | u16 aspmlevel = 0; |
176 | u8 tmp_u1b = 0; | 228 | u8 tmp_u1b = 0; |
177 | 229 | ||
230 | if (!ppsc->support_aspm) | ||
231 | return; | ||
232 | |||
178 | if (pcibridge_vendor == PCI_BRIDGE_VENDOR_UNKNOWN) { | 233 | if (pcibridge_vendor == PCI_BRIDGE_VENDOR_UNKNOWN) { |
179 | RT_TRACE(rtlpriv, COMP_POWER, DBG_TRACE, | 234 | RT_TRACE(rtlpriv, COMP_POWER, DBG_TRACE, |
180 | ("PCI(Bridge) UNKNOWN.\n")); | 235 | ("PCI(Bridge) UNKNOWN.\n")); |
@@ -228,6 +283,9 @@ static void rtl_pci_enable_aspm(struct ieee80211_hw *hw) | |||
228 | u8 u_pcibridge_aspmsetting; | 283 | u8 u_pcibridge_aspmsetting; |
229 | u8 u_device_aspmsetting; | 284 | u8 u_device_aspmsetting; |
230 | 285 | ||
286 | if (!ppsc->support_aspm) | ||
287 | return; | ||
288 | |||
231 | if (pcibridge_vendor == PCI_BRIDGE_VENDOR_UNKNOWN) { | 289 | if (pcibridge_vendor == PCI_BRIDGE_VENDOR_UNKNOWN) { |
232 | RT_TRACE(rtlpriv, COMP_POWER, DBG_TRACE, | 290 | RT_TRACE(rtlpriv, COMP_POWER, DBG_TRACE, |
233 | ("PCI(Bridge) UNKNOWN.\n")); | 291 | ("PCI(Bridge) UNKNOWN.\n")); |
@@ -272,7 +330,7 @@ static void rtl_pci_enable_aspm(struct ieee80211_hw *hw) | |||
272 | RT_RF_OFF_LEVL_CLK_REQ) ? 1 : 0); | 330 | RT_RF_OFF_LEVL_CLK_REQ) ? 1 : 0); |
273 | RT_SET_PS_LEVEL(ppsc, RT_RF_OFF_LEVL_CLK_REQ); | 331 | RT_SET_PS_LEVEL(ppsc, RT_RF_OFF_LEVL_CLK_REQ); |
274 | } | 332 | } |
275 | udelay(200); | 333 | udelay(100); |
276 | } | 334 | } |
277 | 335 | ||
278 | static bool rtl_pci_get_amd_l1_patch(struct ieee80211_hw *hw) | 336 | static bool rtl_pci_get_amd_l1_patch(struct ieee80211_hw *hw) |
@@ -309,13 +367,13 @@ static void rtl_pci_get_linkcontrol_field(struct ieee80211_hw *hw) | |||
309 | u8 capabilityoffset = pcipriv->ndis_adapter.pcibridge_pciehdr_offset; | 367 | u8 capabilityoffset = pcipriv->ndis_adapter.pcibridge_pciehdr_offset; |
310 | u32 pcicfg_addrport = pcipriv->ndis_adapter.pcicfg_addrport; | 368 | u32 pcicfg_addrport = pcipriv->ndis_adapter.pcicfg_addrport; |
311 | u8 linkctrl_reg; | 369 | u8 linkctrl_reg; |
312 | u8 num4bBytes; | 370 | u8 num4bbytes; |
313 | 371 | ||
314 | num4bBytes = (capabilityoffset + 0x10) / 4; | 372 | num4bbytes = (capabilityoffset + 0x10) / 4; |
315 | 373 | ||
316 | /*Read Link Control Register */ | 374 | /*Read Link Control Register */ |
317 | rtl_pci_raw_write_port_ulong(PCI_CONF_ADDRESS, | 375 | rtl_pci_raw_write_port_ulong(PCI_CONF_ADDRESS, |
318 | pcicfg_addrport + (num4bBytes << 2)); | 376 | pcicfg_addrport + (num4bbytes << 2)); |
319 | rtl_pci_raw_read_port_uchar(PCI_CONF_DATA, &linkctrl_reg); | 377 | rtl_pci_raw_read_port_uchar(PCI_CONF_DATA, &linkctrl_reg); |
320 | 378 | ||
321 | pcipriv->ndis_adapter.pcibridge_linkctrlreg = linkctrl_reg; | 379 | pcipriv->ndis_adapter.pcibridge_linkctrlreg = linkctrl_reg; |
@@ -348,7 +406,7 @@ static void rtl_pci_parse_configuration(struct pci_dev *pdev, | |||
348 | pci_write_config_byte(pdev, 0x70f, tmp); | 406 | pci_write_config_byte(pdev, 0x70f, tmp); |
349 | } | 407 | } |
350 | 408 | ||
351 | static void _rtl_pci_initialize_adapter_common(struct ieee80211_hw *hw) | 409 | static void rtl_pci_init_aspm(struct ieee80211_hw *hw) |
352 | { | 410 | { |
353 | struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); | 411 | struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); |
354 | 412 | ||
@@ -362,52 +420,6 @@ static void _rtl_pci_initialize_adapter_common(struct ieee80211_hw *hw) | |||
362 | 420 | ||
363 | } | 421 | } |
364 | 422 | ||
365 | static void rtl_pci_init_aspm(struct ieee80211_hw *hw) | ||
366 | { | ||
367 | struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); | ||
368 | |||
369 | /*close ASPM for AMD defaultly */ | ||
370 | rtlpci->const_amdpci_aspm = 0; | ||
371 | |||
372 | /* | ||
373 | * ASPM PS mode. | ||
374 | * 0 - Disable ASPM, | ||
375 | * 1 - Enable ASPM without Clock Req, | ||
376 | * 2 - Enable ASPM with Clock Req, | ||
377 | * 3 - Always Enable ASPM with Clock Req, | ||
378 | * 4 - Always Enable ASPM without Clock Req. | ||
379 | * set defult to RTL8192CE:3 RTL8192E:2 | ||
380 | * */ | ||
381 | rtlpci->const_pci_aspm = 3; | ||
382 | |||
383 | /*Setting for PCI-E device */ | ||
384 | rtlpci->const_devicepci_aspm_setting = 0x03; | ||
385 | |||
386 | /*Setting for PCI-E bridge */ | ||
387 | rtlpci->const_hostpci_aspm_setting = 0x02; | ||
388 | |||
389 | /* | ||
390 | * In Hw/Sw Radio Off situation. | ||
391 | * 0 - Default, | ||
392 | * 1 - From ASPM setting without low Mac Pwr, | ||
393 | * 2 - From ASPM setting with low Mac Pwr, | ||
394 | * 3 - Bus D3 | ||
395 | * set default to RTL8192CE:0 RTL8192SE:2 | ||
396 | */ | ||
397 | rtlpci->const_hwsw_rfoff_d3 = 0; | ||
398 | |||
399 | /* | ||
400 | * This setting works for those device with | ||
401 | * backdoor ASPM setting such as EPHY setting. | ||
402 | * 0 - Not support ASPM, | ||
403 | * 1 - Support ASPM, | ||
404 | * 2 - According to chipset. | ||
405 | */ | ||
406 | rtlpci->const_support_pciaspm = 1; | ||
407 | |||
408 | _rtl_pci_initialize_adapter_common(hw); | ||
409 | } | ||
410 | |||
411 | static void _rtl_pci_io_handler_init(struct device *dev, | 423 | static void _rtl_pci_io_handler_init(struct device *dev, |
412 | struct ieee80211_hw *hw) | 424 | struct ieee80211_hw *hw) |
413 | { | 425 | { |
@@ -429,6 +441,90 @@ static void _rtl_pci_io_handler_release(struct ieee80211_hw *hw) | |||
429 | { | 441 | { |
430 | } | 442 | } |
431 | 443 | ||
444 | static bool _rtl_update_earlymode_info(struct ieee80211_hw *hw, | ||
445 | struct sk_buff *skb, struct rtl_tcb_desc *tcb_desc, u8 tid) | ||
446 | { | ||
447 | struct rtl_priv *rtlpriv = rtl_priv(hw); | ||
448 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | ||
449 | u8 additionlen = FCS_LEN; | ||
450 | struct sk_buff *next_skb; | ||
451 | |||
452 | /* here open is 4, wep/tkip is 8, aes is 12*/ | ||
453 | if (info->control.hw_key) | ||
454 | additionlen += info->control.hw_key->icv_len; | ||
455 | |||
456 | /* The most skb num is 6 */ | ||
457 | tcb_desc->empkt_num = 0; | ||
458 | spin_lock_bh(&rtlpriv->locks.waitq_lock); | ||
459 | skb_queue_walk(&rtlpriv->mac80211.skb_waitq[tid], next_skb) { | ||
460 | struct ieee80211_tx_info *next_info; | ||
461 | |||
462 | next_info = IEEE80211_SKB_CB(next_skb); | ||
463 | if (next_info->flags & IEEE80211_TX_CTL_AMPDU) { | ||
464 | tcb_desc->empkt_len[tcb_desc->empkt_num] = | ||
465 | next_skb->len + additionlen; | ||
466 | tcb_desc->empkt_num++; | ||
467 | } else { | ||
468 | break; | ||
469 | } | ||
470 | |||
471 | if (skb_queue_is_last(&rtlpriv->mac80211.skb_waitq[tid], | ||
472 | next_skb)) | ||
473 | break; | ||
474 | |||
475 | if (tcb_desc->empkt_num >= 5) | ||
476 | break; | ||
477 | } | ||
478 | spin_unlock_bh(&rtlpriv->locks.waitq_lock); | ||
479 | |||
480 | return true; | ||
481 | } | ||
482 | |||
483 | /* just for early mode now */ | ||
484 | static void _rtl_pci_tx_chk_waitq(struct ieee80211_hw *hw) | ||
485 | { | ||
486 | struct rtl_priv *rtlpriv = rtl_priv(hw); | ||
487 | struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); | ||
488 | struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); | ||
489 | struct sk_buff *skb = NULL; | ||
490 | struct ieee80211_tx_info *info = NULL; | ||
491 | int tid; /* should be int */ | ||
492 | |||
493 | if (!rtlpriv->rtlhal.earlymode_enable) | ||
494 | return; | ||
495 | |||
496 | /* we juse use em for BE/BK/VI/VO */ | ||
497 | for (tid = 7; tid >= 0; tid--) { | ||
498 | u8 hw_queue = ac_to_hwq[rtl_tid_to_ac(hw, tid)]; | ||
499 | struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[hw_queue]; | ||
500 | while (!mac->act_scanning && | ||
501 | rtlpriv->psc.rfpwr_state == ERFON) { | ||
502 | struct rtl_tcb_desc tcb_desc; | ||
503 | memset(&tcb_desc, 0, sizeof(struct rtl_tcb_desc)); | ||
504 | |||
505 | spin_lock_bh(&rtlpriv->locks.waitq_lock); | ||
506 | if (!skb_queue_empty(&mac->skb_waitq[tid]) && | ||
507 | (ring->entries - skb_queue_len(&ring->queue) > 5)) { | ||
508 | skb = skb_dequeue(&mac->skb_waitq[tid]); | ||
509 | } else { | ||
510 | spin_unlock_bh(&rtlpriv->locks.waitq_lock); | ||
511 | break; | ||
512 | } | ||
513 | spin_unlock_bh(&rtlpriv->locks.waitq_lock); | ||
514 | |||
515 | /* Some macaddr can't do early mode. like | ||
516 | * multicast/broadcast/no_qos data */ | ||
517 | info = IEEE80211_SKB_CB(skb); | ||
518 | if (info->flags & IEEE80211_TX_CTL_AMPDU) | ||
519 | _rtl_update_earlymode_info(hw, skb, | ||
520 | &tcb_desc, tid); | ||
521 | |||
522 | rtlpriv->intf_ops->adapter_tx(hw, skb, &tcb_desc); | ||
523 | } | ||
524 | } | ||
525 | } | ||
526 | |||
527 | |||
432 | static void _rtl_pci_tx_isr(struct ieee80211_hw *hw, int prio) | 528 | static void _rtl_pci_tx_isr(struct ieee80211_hw *hw, int prio) |
433 | { | 529 | { |
434 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 530 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
@@ -440,6 +536,8 @@ static void _rtl_pci_tx_isr(struct ieee80211_hw *hw, int prio) | |||
440 | struct rtl_tx_desc *entry = &ring->desc[ring->idx]; | 536 | struct rtl_tx_desc *entry = &ring->desc[ring->idx]; |
441 | struct sk_buff *skb; | 537 | struct sk_buff *skb; |
442 | struct ieee80211_tx_info *info; | 538 | struct ieee80211_tx_info *info; |
539 | __le16 fc; | ||
540 | u8 tid; | ||
443 | 541 | ||
444 | u8 own = (u8) rtlpriv->cfg->ops->get_desc((u8 *) entry, true, | 542 | u8 own = (u8) rtlpriv->cfg->ops->get_desc((u8 *) entry, true, |
445 | HW_DESC_OWN); | 543 | HW_DESC_OWN); |
@@ -460,6 +558,10 @@ static void _rtl_pci_tx_isr(struct ieee80211_hw *hw, int prio) | |||
460 | HW_DESC_TXBUFF_ADDR), | 558 | HW_DESC_TXBUFF_ADDR), |
461 | skb->len, PCI_DMA_TODEVICE); | 559 | skb->len, PCI_DMA_TODEVICE); |
462 | 560 | ||
561 | /* remove early mode header */ | ||
562 | if (rtlpriv->rtlhal.earlymode_enable) | ||
563 | skb_pull(skb, EM_HDR_LEN); | ||
564 | |||
463 | RT_TRACE(rtlpriv, (COMP_INTR | COMP_SEND), DBG_TRACE, | 565 | RT_TRACE(rtlpriv, (COMP_INTR | COMP_SEND), DBG_TRACE, |
464 | ("new ring->idx:%d, " | 566 | ("new ring->idx:%d, " |
465 | "free: skb_queue_len:%d, free: seq:%x\n", | 567 | "free: skb_queue_len:%d, free: seq:%x\n", |
@@ -467,6 +569,30 @@ static void _rtl_pci_tx_isr(struct ieee80211_hw *hw, int prio) | |||
467 | skb_queue_len(&ring->queue), | 569 | skb_queue_len(&ring->queue), |
468 | *(u16 *) (skb->data + 22))); | 570 | *(u16 *) (skb->data + 22))); |
469 | 571 | ||
572 | if (prio == TXCMD_QUEUE) { | ||
573 | dev_kfree_skb(skb); | ||
574 | goto tx_status_ok; | ||
575 | |||
576 | } | ||
577 | |||
578 | /* for sw LPS, just after NULL skb send out, we can | ||
579 | * sure AP kown we are sleeped, our we should not let | ||
580 | * rf to sleep*/ | ||
581 | fc = rtl_get_fc(skb); | ||
582 | if (ieee80211_is_nullfunc(fc)) { | ||
583 | if (ieee80211_has_pm(fc)) { | ||
584 | rtlpriv->mac80211.offchan_deley = true; | ||
585 | rtlpriv->psc.state_inap = 1; | ||
586 | } else { | ||
587 | rtlpriv->psc.state_inap = 0; | ||
588 | } | ||
589 | } | ||
590 | |||
591 | /* update tid tx pkt num */ | ||
592 | tid = rtl_get_tid(skb); | ||
593 | if (tid <= 7) | ||
594 | rtlpriv->link_info.tidtx_inperiod[tid]++; | ||
595 | |||
470 | info = IEEE80211_SKB_CB(skb); | 596 | info = IEEE80211_SKB_CB(skb); |
471 | ieee80211_tx_info_clear_status(info); | 597 | ieee80211_tx_info_clear_status(info); |
472 | 598 | ||
@@ -489,7 +615,7 @@ static void _rtl_pci_tx_isr(struct ieee80211_hw *hw, int prio) | |||
489 | skb_get_queue_mapping | 615 | skb_get_queue_mapping |
490 | (skb)); | 616 | (skb)); |
491 | } | 617 | } |
492 | 618 | tx_status_ok: | |
493 | skb = NULL; | 619 | skb = NULL; |
494 | } | 620 | } |
495 | 621 | ||
@@ -561,23 +687,21 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) | |||
561 | *skb_trim(skb, skb->len - 4); | 687 | *skb_trim(skb, skb->len - 4); |
562 | */ | 688 | */ |
563 | 689 | ||
564 | hdr = (struct ieee80211_hdr *)(skb->data); | 690 | hdr = rtl_get_hdr(skb); |
565 | fc = hdr->frame_control; | 691 | fc = rtl_get_fc(skb); |
566 | 692 | ||
567 | if (!stats.crc) { | 693 | if (!stats.crc || !stats.hwerror) { |
568 | memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, | 694 | memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, |
569 | sizeof(rx_status)); | 695 | sizeof(rx_status)); |
570 | 696 | ||
571 | if (is_broadcast_ether_addr(hdr->addr1)) | 697 | if (is_broadcast_ether_addr(hdr->addr1)) { |
572 | ;/*TODO*/ | 698 | ;/*TODO*/ |
573 | else { | 699 | } else if (is_multicast_ether_addr(hdr->addr1)) { |
574 | if (is_multicast_ether_addr(hdr->addr1)) | 700 | ;/*TODO*/ |
575 | ;/*TODO*/ | 701 | } else { |
576 | else { | 702 | unicast = true; |
577 | unicast = true; | 703 | rtlpriv->stats.rxbytesunicast += |
578 | rtlpriv->stats.rxbytesunicast += | 704 | skb->len; |
579 | skb->len; | ||
580 | } | ||
581 | } | 705 | } |
582 | 706 | ||
583 | rtl_is_special_data(hw, skb, false); | 707 | rtl_is_special_data(hw, skb, false); |
@@ -591,28 +715,38 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) | |||
591 | num_rx_inperiod++; | 715 | num_rx_inperiod++; |
592 | } | 716 | } |
593 | 717 | ||
594 | if (unlikely(!rtl_action_proc(hw, skb, | 718 | /* for sw lps */ |
595 | false))) { | 719 | rtl_swlps_beacon(hw, (void *)skb->data, |
720 | skb->len); | ||
721 | rtl_recognize_peer(hw, (void *)skb->data, | ||
722 | skb->len); | ||
723 | if ((rtlpriv->mac80211.opmode == | ||
724 | NL80211_IFTYPE_AP) && | ||
725 | (rtlpriv->rtlhal.current_bandtype == | ||
726 | BAND_ON_2_4G) && | ||
727 | (ieee80211_is_beacon(fc) || | ||
728 | ieee80211_is_probe_resp(fc))) { | ||
596 | dev_kfree_skb_any(skb); | 729 | dev_kfree_skb_any(skb); |
597 | } else { | 730 | } else { |
598 | struct sk_buff *uskb = NULL; | 731 | if (unlikely(!rtl_action_proc(hw, skb, |
599 | u8 *pdata; | 732 | false))) { |
600 | uskb = dev_alloc_skb(skb->len + 128); | 733 | dev_kfree_skb_any(skb); |
601 | if (!uskb) { | 734 | } else { |
602 | RT_TRACE(rtlpriv, | 735 | struct sk_buff *uskb = NULL; |
603 | (COMP_INTR | COMP_RECV), | 736 | u8 *pdata; |
604 | DBG_EMERG, | 737 | uskb = dev_alloc_skb(skb->len |
605 | ("can't alloc rx skb\n")); | 738 | + 128); |
606 | goto done; | 739 | memcpy(IEEE80211_SKB_RXCB(uskb), |
740 | &rx_status, | ||
741 | sizeof(rx_status)); | ||
742 | pdata = (u8 *)skb_put(uskb, | ||
743 | skb->len); | ||
744 | memcpy(pdata, skb->data, | ||
745 | skb->len); | ||
746 | dev_kfree_skb_any(skb); | ||
747 | |||
748 | ieee80211_rx_irqsafe(hw, uskb); | ||
607 | } | 749 | } |
608 | memcpy(IEEE80211_SKB_RXCB(uskb), | ||
609 | &rx_status, | ||
610 | sizeof(rx_status)); | ||
611 | pdata = (u8 *)skb_put(uskb, skb->len); | ||
612 | memcpy(pdata, skb->data, skb->len); | ||
613 | dev_kfree_skb_any(skb); | ||
614 | |||
615 | ieee80211_rx_irqsafe(hw, uskb); | ||
616 | } | 750 | } |
617 | } else { | 751 | } else { |
618 | dev_kfree_skb_any(skb); | 752 | dev_kfree_skb_any(skb); |
@@ -627,7 +761,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) | |||
627 | new_skb = dev_alloc_skb(rtlpci->rxbuffersize); | 761 | new_skb = dev_alloc_skb(rtlpci->rxbuffersize); |
628 | if (unlikely(!new_skb)) { | 762 | if (unlikely(!new_skb)) { |
629 | RT_TRACE(rtlpriv, (COMP_INTR | COMP_RECV), | 763 | RT_TRACE(rtlpriv, (COMP_INTR | COMP_RECV), |
630 | DBG_EMERG, | 764 | DBG_DMESG, |
631 | ("can't alloc skb for rx\n")); | 765 | ("can't alloc skb for rx\n")); |
632 | goto done; | 766 | goto done; |
633 | } | 767 | } |
@@ -645,7 +779,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) | |||
645 | 779 | ||
646 | } | 780 | } |
647 | done: | 781 | done: |
648 | bufferaddress = (u32)(*((dma_addr_t *) skb->cb)); | 782 | bufferaddress = (*((dma_addr_t *)skb->cb)); |
649 | tmp_one = 1; | 783 | tmp_one = 1; |
650 | rtlpriv->cfg->ops->set_desc((u8 *) pdesc, false, | 784 | rtlpriv->cfg->ops->set_desc((u8 *) pdesc, false, |
651 | HW_DESC_RXBUFF_ADDR, | 785 | HW_DESC_RXBUFF_ADDR, |
@@ -674,6 +808,7 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id) | |||
674 | struct ieee80211_hw *hw = dev_id; | 808 | struct ieee80211_hw *hw = dev_id; |
675 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 809 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
676 | struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); | 810 | struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); |
811 | struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); | ||
677 | unsigned long flags; | 812 | unsigned long flags; |
678 | u32 inta = 0; | 813 | u32 inta = 0; |
679 | u32 intb = 0; | 814 | u32 intb = 0; |
@@ -760,23 +895,36 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id) | |||
760 | _rtl_pci_tx_isr(hw, VO_QUEUE); | 895 | _rtl_pci_tx_isr(hw, VO_QUEUE); |
761 | } | 896 | } |
762 | 897 | ||
898 | if (rtlhal->hw_type == HARDWARE_TYPE_RTL8192SE) { | ||
899 | if (inta & rtlpriv->cfg->maps[RTL_IMR_COMDOK]) { | ||
900 | rtlpriv->link_info.num_tx_inperiod++; | ||
901 | |||
902 | RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, | ||
903 | ("CMD TX OK interrupt!\n")); | ||
904 | _rtl_pci_tx_isr(hw, TXCMD_QUEUE); | ||
905 | } | ||
906 | } | ||
907 | |||
763 | /*<2> Rx related */ | 908 | /*<2> Rx related */ |
764 | if (inta & rtlpriv->cfg->maps[RTL_IMR_ROK]) { | 909 | if (inta & rtlpriv->cfg->maps[RTL_IMR_ROK]) { |
765 | RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, ("Rx ok interrupt!\n")); | 910 | RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, ("Rx ok interrupt!\n")); |
766 | tasklet_schedule(&rtlpriv->works.irq_tasklet); | 911 | _rtl_pci_rx_interrupt(hw); |
767 | } | 912 | } |
768 | 913 | ||
769 | if (unlikely(inta & rtlpriv->cfg->maps[RTL_IMR_RDU])) { | 914 | if (unlikely(inta & rtlpriv->cfg->maps[RTL_IMR_RDU])) { |
770 | RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, | 915 | RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, |
771 | ("rx descriptor unavailable!\n")); | 916 | ("rx descriptor unavailable!\n")); |
772 | tasklet_schedule(&rtlpriv->works.irq_tasklet); | 917 | _rtl_pci_rx_interrupt(hw); |
773 | } | 918 | } |
774 | 919 | ||
775 | if (unlikely(inta & rtlpriv->cfg->maps[RTL_IMR_RXFOVW])) { | 920 | if (unlikely(inta & rtlpriv->cfg->maps[RTL_IMR_RXFOVW])) { |
776 | RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, ("rx overflow !\n")); | 921 | RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, ("rx overflow !\n")); |
777 | tasklet_schedule(&rtlpriv->works.irq_tasklet); | 922 | _rtl_pci_rx_interrupt(hw); |
778 | } | 923 | } |
779 | 924 | ||
925 | if (rtlpriv->rtlhal.earlymode_enable) | ||
926 | tasklet_schedule(&rtlpriv->works.irq_tasklet); | ||
927 | |||
780 | spin_unlock_irqrestore(&rtlpriv->locks.irq_th_lock, flags); | 928 | spin_unlock_irqrestore(&rtlpriv->locks.irq_th_lock, flags); |
781 | return IRQ_HANDLED; | 929 | return IRQ_HANDLED; |
782 | 930 | ||
@@ -787,7 +935,7 @@ done: | |||
787 | 935 | ||
788 | static void _rtl_pci_irq_tasklet(struct ieee80211_hw *hw) | 936 | static void _rtl_pci_irq_tasklet(struct ieee80211_hw *hw) |
789 | { | 937 | { |
790 | _rtl_pci_rx_interrupt(hw); | 938 | _rtl_pci_tx_chk_waitq(hw); |
791 | } | 939 | } |
792 | 940 | ||
793 | static void _rtl_pci_prepare_bcn_tasklet(struct ieee80211_hw *hw) | 941 | static void _rtl_pci_prepare_bcn_tasklet(struct ieee80211_hw *hw) |
@@ -795,14 +943,15 @@ static void _rtl_pci_prepare_bcn_tasklet(struct ieee80211_hw *hw) | |||
795 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 943 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
796 | struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); | 944 | struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); |
797 | struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); | 945 | struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); |
798 | struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[BEACON_QUEUE]; | 946 | struct rtl8192_tx_ring *ring = NULL; |
799 | struct ieee80211_hdr *hdr = NULL; | 947 | struct ieee80211_hdr *hdr = NULL; |
800 | struct ieee80211_tx_info *info = NULL; | 948 | struct ieee80211_tx_info *info = NULL; |
801 | struct sk_buff *pskb = NULL; | 949 | struct sk_buff *pskb = NULL; |
802 | struct rtl_tx_desc *pdesc = NULL; | 950 | struct rtl_tx_desc *pdesc = NULL; |
803 | unsigned int queue_index; | 951 | struct rtl_tcb_desc tcb_desc; |
804 | u8 temp_one = 1; | 952 | u8 temp_one = 1; |
805 | 953 | ||
954 | memset(&tcb_desc, 0, sizeof(struct rtl_tcb_desc)); | ||
806 | ring = &rtlpci->tx_ring[BEACON_QUEUE]; | 955 | ring = &rtlpci->tx_ring[BEACON_QUEUE]; |
807 | pskb = __skb_dequeue(&ring->queue); | 956 | pskb = __skb_dequeue(&ring->queue); |
808 | if (pskb) | 957 | if (pskb) |
@@ -812,14 +961,11 @@ static void _rtl_pci_prepare_bcn_tasklet(struct ieee80211_hw *hw) | |||
812 | pskb = ieee80211_beacon_get(hw, mac->vif); | 961 | pskb = ieee80211_beacon_get(hw, mac->vif); |
813 | if (pskb == NULL) | 962 | if (pskb == NULL) |
814 | return; | 963 | return; |
815 | hdr = (struct ieee80211_hdr *)(pskb->data); | 964 | hdr = rtl_get_hdr(pskb); |
816 | info = IEEE80211_SKB_CB(pskb); | 965 | info = IEEE80211_SKB_CB(pskb); |
817 | |||
818 | queue_index = BEACON_QUEUE; | ||
819 | |||
820 | pdesc = &ring->desc[0]; | 966 | pdesc = &ring->desc[0]; |
821 | rtlpriv->cfg->ops->fill_tx_desc(hw, hdr, (u8 *) pdesc, | 967 | rtlpriv->cfg->ops->fill_tx_desc(hw, hdr, (u8 *) pdesc, |
822 | info, pskb, queue_index); | 968 | info, pskb, BEACON_QUEUE, &tcb_desc); |
823 | 969 | ||
824 | __skb_queue_tail(&ring->queue, pskb); | 970 | __skb_queue_tail(&ring->queue, pskb); |
825 | 971 | ||
@@ -861,7 +1007,6 @@ static void _rtl_pci_init_struct(struct ieee80211_hw *hw, | |||
861 | struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); | 1007 | struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); |
862 | struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); | 1008 | struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); |
863 | struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); | 1009 | struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); |
864 | struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); | ||
865 | 1010 | ||
866 | rtlpci->up_first_time = true; | 1011 | rtlpci->up_first_time = true; |
867 | rtlpci->being_init_adapter = false; | 1012 | rtlpci->being_init_adapter = false; |
@@ -869,31 +1014,20 @@ static void _rtl_pci_init_struct(struct ieee80211_hw *hw, | |||
869 | rtlhal->hw = hw; | 1014 | rtlhal->hw = hw; |
870 | rtlpci->pdev = pdev; | 1015 | rtlpci->pdev = pdev; |
871 | 1016 | ||
872 | ppsc->inactiveps = false; | ||
873 | ppsc->leisure_ps = true; | ||
874 | ppsc->fwctrl_lps = true; | ||
875 | ppsc->reg_fwctrl_lps = 3; | ||
876 | ppsc->reg_max_lps_awakeintvl = 5; | ||
877 | |||
878 | if (ppsc->reg_fwctrl_lps == 1) | ||
879 | ppsc->fwctrl_psmode = FW_PS_MIN_MODE; | ||
880 | else if (ppsc->reg_fwctrl_lps == 2) | ||
881 | ppsc->fwctrl_psmode = FW_PS_MAX_MODE; | ||
882 | else if (ppsc->reg_fwctrl_lps == 3) | ||
883 | ppsc->fwctrl_psmode = FW_PS_DTIM_MODE; | ||
884 | |||
885 | /*Tx/Rx related var */ | 1017 | /*Tx/Rx related var */ |
886 | _rtl_pci_init_trx_var(hw); | 1018 | _rtl_pci_init_trx_var(hw); |
887 | 1019 | ||
888 | /*IBSS*/ mac->beacon_interval = 100; | 1020 | /*IBSS*/ mac->beacon_interval = 100; |
889 | 1021 | ||
890 | /*AMPDU*/ mac->min_space_cfg = 0; | 1022 | /*AMPDU*/ |
1023 | mac->min_space_cfg = 0; | ||
891 | mac->max_mss_density = 0; | 1024 | mac->max_mss_density = 0; |
892 | /*set sane AMPDU defaults */ | 1025 | /*set sane AMPDU defaults */ |
893 | mac->current_ampdu_density = 7; | 1026 | mac->current_ampdu_density = 7; |
894 | mac->current_ampdu_factor = 3; | 1027 | mac->current_ampdu_factor = 3; |
895 | 1028 | ||
896 | /*QOS*/ rtlpci->acm_method = eAcmWay2_SW; | 1029 | /*QOS*/ |
1030 | rtlpci->acm_method = eAcmWay2_SW; | ||
897 | 1031 | ||
898 | /*task */ | 1032 | /*task */ |
899 | tasklet_init(&rtlpriv->works.irq_tasklet, | 1033 | tasklet_init(&rtlpriv->works.irq_tasklet, |
@@ -934,7 +1068,8 @@ static int _rtl_pci_init_tx_ring(struct ieee80211_hw *hw, | |||
934 | ("queue:%d, ring_addr:%p\n", prio, ring)); | 1068 | ("queue:%d, ring_addr:%p\n", prio, ring)); |
935 | 1069 | ||
936 | for (i = 0; i < entries; i++) { | 1070 | for (i = 0; i < entries; i++) { |
937 | nextdescaddress = (u32) dma + ((i + 1) % entries) * | 1071 | nextdescaddress = (u32) dma + |
1072 | ((i + 1) % entries) * | ||
938 | sizeof(*ring); | 1073 | sizeof(*ring); |
939 | 1074 | ||
940 | rtlpriv->cfg->ops->set_desc((u8 *)&(ring[i]), | 1075 | rtlpriv->cfg->ops->set_desc((u8 *)&(ring[i]), |
@@ -999,7 +1134,7 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw) | |||
999 | rtlpci->rxbuffersize, | 1134 | rtlpci->rxbuffersize, |
1000 | PCI_DMA_FROMDEVICE); | 1135 | PCI_DMA_FROMDEVICE); |
1001 | 1136 | ||
1002 | bufferaddress = (u32)(*((dma_addr_t *)skb->cb)); | 1137 | bufferaddress = (*((dma_addr_t *)skb->cb)); |
1003 | rtlpriv->cfg->ops->set_desc((u8 *)entry, false, | 1138 | rtlpriv->cfg->ops->set_desc((u8 *)entry, false, |
1004 | HW_DESC_RXBUFF_ADDR, | 1139 | HW_DESC_RXBUFF_ADDR, |
1005 | (u8 *)&bufferaddress); | 1140 | (u8 *)&bufferaddress); |
@@ -1182,72 +1317,73 @@ int rtl_pci_reset_trx_ring(struct ieee80211_hw *hw) | |||
1182 | return 0; | 1317 | return 0; |
1183 | } | 1318 | } |
1184 | 1319 | ||
1185 | static unsigned int _rtl_mac_to_hwqueue(__le16 fc, | 1320 | static bool rtl_pci_tx_chk_waitq_insert(struct ieee80211_hw *hw, |
1186 | unsigned int mac80211_queue_index) | 1321 | struct sk_buff *skb) |
1187 | { | 1322 | { |
1188 | unsigned int hw_queue_index; | 1323 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
1189 | 1324 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | |
1190 | if (unlikely(ieee80211_is_beacon(fc))) { | 1325 | struct ieee80211_sta *sta = info->control.sta; |
1191 | hw_queue_index = BEACON_QUEUE; | 1326 | struct rtl_sta_info *sta_entry = NULL; |
1192 | goto out; | 1327 | u8 tid = rtl_get_tid(skb); |
1193 | } | 1328 | |
1194 | 1329 | if (!sta) | |
1195 | if (ieee80211_is_mgmt(fc)) { | 1330 | return false; |
1196 | hw_queue_index = MGNT_QUEUE; | 1331 | sta_entry = (struct rtl_sta_info *)sta->drv_priv; |
1197 | goto out; | 1332 | |
1198 | } | 1333 | if (!rtlpriv->rtlhal.earlymode_enable) |
1199 | 1334 | return false; | |
1200 | switch (mac80211_queue_index) { | 1335 | if (sta_entry->tids[tid].agg.agg_state != RTL_AGG_OPERATIONAL) |
1201 | case 0: | 1336 | return false; |
1202 | hw_queue_index = VO_QUEUE; | 1337 | if (_rtl_mac_to_hwqueue(hw, skb) > VO_QUEUE) |
1203 | break; | 1338 | return false; |
1204 | case 1: | 1339 | if (tid > 7) |
1205 | hw_queue_index = VI_QUEUE; | 1340 | return false; |
1206 | break; | 1341 | |
1207 | case 2: | 1342 | /* maybe every tid should be checked */ |
1208 | hw_queue_index = BE_QUEUE;; | 1343 | if (!rtlpriv->link_info.higher_busytxtraffic[tid]) |
1209 | break; | 1344 | return false; |
1210 | case 3: | 1345 | |
1211 | hw_queue_index = BK_QUEUE; | 1346 | spin_lock_bh(&rtlpriv->locks.waitq_lock); |
1212 | break; | 1347 | skb_queue_tail(&rtlpriv->mac80211.skb_waitq[tid], skb); |
1213 | default: | 1348 | spin_unlock_bh(&rtlpriv->locks.waitq_lock); |
1214 | hw_queue_index = BE_QUEUE; | ||
1215 | RT_ASSERT(false, ("QSLT_BE queue, skb_queue:%d\n", | ||
1216 | mac80211_queue_index)); | ||
1217 | break; | ||
1218 | } | ||
1219 | 1349 | ||
1220 | out: | 1350 | return true; |
1221 | return hw_queue_index; | ||
1222 | } | 1351 | } |
1223 | 1352 | ||
1224 | static int rtl_pci_tx(struct ieee80211_hw *hw, struct sk_buff *skb) | 1353 | static int rtl_pci_tx(struct ieee80211_hw *hw, struct sk_buff *skb, |
1354 | struct rtl_tcb_desc *ptcb_desc) | ||
1225 | { | 1355 | { |
1226 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 1356 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
1227 | struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); | 1357 | struct rtl_sta_info *sta_entry = NULL; |
1228 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | 1358 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
1359 | struct ieee80211_sta *sta = info->control.sta; | ||
1229 | struct rtl8192_tx_ring *ring; | 1360 | struct rtl8192_tx_ring *ring; |
1230 | struct rtl_tx_desc *pdesc; | 1361 | struct rtl_tx_desc *pdesc; |
1231 | u8 idx; | 1362 | u8 idx; |
1232 | unsigned int queue_index, hw_queue; | 1363 | u8 hw_queue = _rtl_mac_to_hwqueue(hw, skb); |
1233 | unsigned long flags; | 1364 | unsigned long flags; |
1234 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data); | 1365 | struct ieee80211_hdr *hdr = rtl_get_hdr(skb); |
1235 | __le16 fc = hdr->frame_control; | 1366 | __le16 fc = rtl_get_fc(skb); |
1236 | u8 *pda_addr = hdr->addr1; | 1367 | u8 *pda_addr = hdr->addr1; |
1237 | struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); | 1368 | struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); |
1238 | /*ssn */ | 1369 | /*ssn */ |
1239 | u8 *qc = NULL; | ||
1240 | u8 tid = 0; | 1370 | u8 tid = 0; |
1241 | u16 seq_number = 0; | 1371 | u16 seq_number = 0; |
1242 | u8 own; | 1372 | u8 own; |
1243 | u8 temp_one = 1; | 1373 | u8 temp_one = 1; |
1244 | 1374 | ||
1245 | if (ieee80211_is_mgmt(fc)) | 1375 | if (ieee80211_is_auth(fc)) { |
1246 | rtl_tx_mgmt_proc(hw, skb); | 1376 | RT_TRACE(rtlpriv, COMP_SEND, DBG_DMESG, ("MAC80211_LINKING\n")); |
1247 | rtl_action_proc(hw, skb, true); | 1377 | rtl_ips_nic_on(hw); |
1378 | } | ||
1379 | |||
1380 | if (rtlpriv->psc.sw_ps_enabled) { | ||
1381 | if (ieee80211_is_data(fc) && !ieee80211_is_nullfunc(fc) && | ||
1382 | !ieee80211_has_pm(fc)) | ||
1383 | hdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_PM); | ||
1384 | } | ||
1248 | 1385 | ||
1249 | queue_index = skb_get_queue_mapping(skb); | 1386 | rtl_action_proc(hw, skb, true); |
1250 | hw_queue = _rtl_mac_to_hwqueue(fc, queue_index); | ||
1251 | 1387 | ||
1252 | if (is_multicast_ether_addr(pda_addr)) | 1388 | if (is_multicast_ether_addr(pda_addr)) |
1253 | rtlpriv->stats.txbytesmulticast += skb->len; | 1389 | rtlpriv->stats.txbytesmulticast += skb->len; |
@@ -1257,7 +1393,6 @@ static int rtl_pci_tx(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
1257 | rtlpriv->stats.txbytesunicast += skb->len; | 1393 | rtlpriv->stats.txbytesunicast += skb->len; |
1258 | 1394 | ||
1259 | spin_lock_irqsave(&rtlpriv->locks.irq_th_lock, flags); | 1395 | spin_lock_irqsave(&rtlpriv->locks.irq_th_lock, flags); |
1260 | |||
1261 | ring = &rtlpci->tx_ring[hw_queue]; | 1396 | ring = &rtlpci->tx_ring[hw_queue]; |
1262 | if (hw_queue != BEACON_QUEUE) | 1397 | if (hw_queue != BEACON_QUEUE) |
1263 | idx = (ring->idx + skb_queue_len(&ring->queue)) % | 1398 | idx = (ring->idx + skb_queue_len(&ring->queue)) % |
@@ -1280,43 +1415,30 @@ static int rtl_pci_tx(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
1280 | return skb->len; | 1415 | return skb->len; |
1281 | } | 1416 | } |
1282 | 1417 | ||
1283 | /* | ||
1284 | *if(ieee80211_is_nullfunc(fc)) { | ||
1285 | * spin_unlock_irqrestore(&rtlpriv->locks.irq_th_lock, flags); | ||
1286 | * return 1; | ||
1287 | *} | ||
1288 | */ | ||
1289 | |||
1290 | if (ieee80211_is_data_qos(fc)) { | 1418 | if (ieee80211_is_data_qos(fc)) { |
1291 | qc = ieee80211_get_qos_ctl(hdr); | 1419 | tid = rtl_get_tid(skb); |
1292 | tid = qc[0] & IEEE80211_QOS_CTL_TID_MASK; | 1420 | if (sta) { |
1293 | 1421 | sta_entry = (struct rtl_sta_info *)sta->drv_priv; | |
1294 | seq_number = mac->tids[tid].seq_number; | 1422 | seq_number = (le16_to_cpu(hdr->seq_ctrl) & |
1295 | seq_number &= IEEE80211_SCTL_SEQ; | 1423 | IEEE80211_SCTL_SEQ) >> 4; |
1296 | /* | 1424 | seq_number += 1; |
1297 | *hdr->seq_ctrl = hdr->seq_ctrl & | 1425 | |
1298 | *cpu_to_le16(IEEE80211_SCTL_FRAG); | 1426 | if (!ieee80211_has_morefrags(hdr->frame_control)) |
1299 | *hdr->seq_ctrl |= cpu_to_le16(seq_number); | 1427 | sta_entry->tids[tid].seq_number = seq_number; |
1300 | */ | 1428 | } |
1301 | |||
1302 | seq_number += 1; | ||
1303 | } | 1429 | } |
1304 | 1430 | ||
1305 | if (ieee80211_is_data(fc)) | 1431 | if (ieee80211_is_data(fc)) |
1306 | rtlpriv->cfg->ops->led_control(hw, LED_CTL_TX); | 1432 | rtlpriv->cfg->ops->led_control(hw, LED_CTL_TX); |
1307 | 1433 | ||
1308 | rtlpriv->cfg->ops->fill_tx_desc(hw, hdr, (u8 *) pdesc, | 1434 | rtlpriv->cfg->ops->fill_tx_desc(hw, hdr, (u8 *)pdesc, |
1309 | info, skb, hw_queue); | 1435 | info, skb, hw_queue, ptcb_desc); |
1310 | 1436 | ||
1311 | __skb_queue_tail(&ring->queue, skb); | 1437 | __skb_queue_tail(&ring->queue, skb); |
1312 | 1438 | ||
1313 | rtlpriv->cfg->ops->set_desc((u8 *) pdesc, true, | 1439 | rtlpriv->cfg->ops->set_desc((u8 *)pdesc, true, |
1314 | HW_DESC_OWN, (u8 *)&temp_one); | 1440 | HW_DESC_OWN, (u8 *)&temp_one); |
1315 | 1441 | ||
1316 | if (!ieee80211_has_morefrags(hdr->frame_control)) { | ||
1317 | if (qc) | ||
1318 | mac->tids[tid].seq_number = seq_number; | ||
1319 | } | ||
1320 | 1442 | ||
1321 | if ((ring->entries - skb_queue_len(&ring->queue)) < 2 && | 1443 | if ((ring->entries - skb_queue_len(&ring->queue)) < 2 && |
1322 | hw_queue != BEACON_QUEUE) { | 1444 | hw_queue != BEACON_QUEUE) { |
@@ -1338,6 +1460,35 @@ static int rtl_pci_tx(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
1338 | return 0; | 1460 | return 0; |
1339 | } | 1461 | } |
1340 | 1462 | ||
1463 | static void rtl_pci_flush(struct ieee80211_hw *hw, bool drop) | ||
1464 | { | ||
1465 | struct rtl_priv *rtlpriv = rtl_priv(hw); | ||
1466 | struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw); | ||
1467 | struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); | ||
1468 | u16 i = 0; | ||
1469 | int queue_id; | ||
1470 | struct rtl8192_tx_ring *ring; | ||
1471 | |||
1472 | for (queue_id = RTL_PCI_MAX_TX_QUEUE_COUNT - 1; queue_id >= 0;) { | ||
1473 | u32 queue_len; | ||
1474 | ring = &pcipriv->dev.tx_ring[queue_id]; | ||
1475 | queue_len = skb_queue_len(&ring->queue); | ||
1476 | if (queue_len == 0 || queue_id == BEACON_QUEUE || | ||
1477 | queue_id == TXCMD_QUEUE) { | ||
1478 | queue_id--; | ||
1479 | continue; | ||
1480 | } else { | ||
1481 | msleep(20); | ||
1482 | i++; | ||
1483 | } | ||
1484 | |||
1485 | /* we just wait 1s for all queues */ | ||
1486 | if (rtlpriv->psc.rfpwr_state == ERFOFF || | ||
1487 | is_hal_stop(rtlhal) || i >= 200) | ||
1488 | return; | ||
1489 | } | ||
1490 | } | ||
1491 | |||
1341 | static void rtl_pci_deinit(struct ieee80211_hw *hw) | 1492 | static void rtl_pci_deinit(struct ieee80211_hw *hw) |
1342 | { | 1493 | { |
1343 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 1494 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
@@ -1456,11 +1607,13 @@ static bool _rtl_pci_find_adapter(struct pci_dev *pdev, | |||
1456 | struct pci_dev *bridge_pdev = pdev->bus->self; | 1607 | struct pci_dev *bridge_pdev = pdev->bus->self; |
1457 | u16 venderid; | 1608 | u16 venderid; |
1458 | u16 deviceid; | 1609 | u16 deviceid; |
1610 | u8 revisionid; | ||
1459 | u16 irqline; | 1611 | u16 irqline; |
1460 | u8 tmp; | 1612 | u8 tmp; |
1461 | 1613 | ||
1462 | venderid = pdev->vendor; | 1614 | venderid = pdev->vendor; |
1463 | deviceid = pdev->device; | 1615 | deviceid = pdev->device; |
1616 | pci_read_config_byte(pdev, 0x8, &revisionid); | ||
1464 | pci_read_config_word(pdev, 0x3C, &irqline); | 1617 | pci_read_config_word(pdev, 0x3C, &irqline); |
1465 | 1618 | ||
1466 | if (deviceid == RTL_PCI_8192_DID || | 1619 | if (deviceid == RTL_PCI_8192_DID || |
@@ -1471,7 +1624,7 @@ static bool _rtl_pci_find_adapter(struct pci_dev *pdev, | |||
1471 | deviceid == RTL_PCI_8173_DID || | 1624 | deviceid == RTL_PCI_8173_DID || |
1472 | deviceid == RTL_PCI_8172_DID || | 1625 | deviceid == RTL_PCI_8172_DID || |
1473 | deviceid == RTL_PCI_8171_DID) { | 1626 | deviceid == RTL_PCI_8171_DID) { |
1474 | switch (pdev->revision) { | 1627 | switch (revisionid) { |
1475 | case RTL_PCI_REVISION_ID_8192PCIE: | 1628 | case RTL_PCI_REVISION_ID_8192PCIE: |
1476 | RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, | 1629 | RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, |
1477 | ("8192 PCI-E is found - " | 1630 | ("8192 PCI-E is found - " |
@@ -1500,6 +1653,12 @@ static bool _rtl_pci_find_adapter(struct pci_dev *pdev, | |||
1500 | RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, | 1653 | RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, |
1501 | ("8192C PCI-E is found - " | 1654 | ("8192C PCI-E is found - " |
1502 | "vid/did=%x/%x\n", venderid, deviceid)); | 1655 | "vid/did=%x/%x\n", venderid, deviceid)); |
1656 | } else if (deviceid == RTL_PCI_8192DE_DID || | ||
1657 | deviceid == RTL_PCI_8192DE_DID2) { | ||
1658 | rtlhal->hw_type = HARDWARE_TYPE_RTL8192DE; | ||
1659 | RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, | ||
1660 | ("8192D PCI-E is found - " | ||
1661 | "vid/did=%x/%x\n", venderid, deviceid)); | ||
1503 | } else { | 1662 | } else { |
1504 | RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, | 1663 | RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, |
1505 | ("Err: Unknown device -" | 1664 | ("Err: Unknown device -" |
@@ -1508,6 +1667,25 @@ static bool _rtl_pci_find_adapter(struct pci_dev *pdev, | |||
1508 | rtlhal->hw_type = RTL_DEFAULT_HARDWARE_TYPE; | 1667 | rtlhal->hw_type = RTL_DEFAULT_HARDWARE_TYPE; |
1509 | } | 1668 | } |
1510 | 1669 | ||
1670 | if (rtlhal->hw_type == HARDWARE_TYPE_RTL8192DE) { | ||
1671 | if (revisionid == 0 || revisionid == 1) { | ||
1672 | if (revisionid == 0) { | ||
1673 | RT_TRACE(rtlpriv, COMP_INIT, | ||
1674 | DBG_LOUD, ("Find 92DE MAC0.\n")); | ||
1675 | rtlhal->interfaceindex = 0; | ||
1676 | } else if (revisionid == 1) { | ||
1677 | RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, | ||
1678 | ("Find 92DE MAC1.\n")); | ||
1679 | rtlhal->interfaceindex = 1; | ||
1680 | } | ||
1681 | } else { | ||
1682 | RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, | ||
1683 | ("Unknown device - " | ||
1684 | "VendorID/DeviceID=%x/%x, Revision=%x\n", | ||
1685 | venderid, deviceid, revisionid)); | ||
1686 | rtlhal->interfaceindex = 0; | ||
1687 | } | ||
1688 | } | ||
1511 | /*find bus info */ | 1689 | /*find bus info */ |
1512 | pcipriv->ndis_adapter.busnumber = pdev->bus->number; | 1690 | pcipriv->ndis_adapter.busnumber = pdev->bus->number; |
1513 | pcipriv->ndis_adapter.devnumber = PCI_SLOT(pdev->devfn); | 1691 | pcipriv->ndis_adapter.devnumber = PCI_SLOT(pdev->devfn); |
@@ -1533,12 +1711,12 @@ static bool _rtl_pci_find_adapter(struct pci_dev *pdev, | |||
1533 | PCI_SLOT(bridge_pdev->devfn); | 1711 | PCI_SLOT(bridge_pdev->devfn); |
1534 | pcipriv->ndis_adapter.pcibridge_funcnum = | 1712 | pcipriv->ndis_adapter.pcibridge_funcnum = |
1535 | PCI_FUNC(bridge_pdev->devfn); | 1713 | PCI_FUNC(bridge_pdev->devfn); |
1536 | pcipriv->ndis_adapter.pcibridge_pciehdr_offset = | ||
1537 | pci_pcie_cap(bridge_pdev); | ||
1538 | pcipriv->ndis_adapter.pcicfg_addrport = | 1714 | pcipriv->ndis_adapter.pcicfg_addrport = |
1539 | (pcipriv->ndis_adapter.pcibridge_busnum << 16) | | 1715 | (pcipriv->ndis_adapter.pcibridge_busnum << 16) | |
1540 | (pcipriv->ndis_adapter.pcibridge_devnum << 11) | | 1716 | (pcipriv->ndis_adapter.pcibridge_devnum << 11) | |
1541 | (pcipriv->ndis_adapter.pcibridge_funcnum << 8) | (1 << 31); | 1717 | (pcipriv->ndis_adapter.pcibridge_funcnum << 8) | (1 << 31); |
1718 | pcipriv->ndis_adapter.pcibridge_pciehdr_offset = | ||
1719 | pci_pcie_cap(bridge_pdev); | ||
1542 | pcipriv->ndis_adapter.num4bytes = | 1720 | pcipriv->ndis_adapter.num4bytes = |
1543 | (pcipriv->ndis_adapter.pcibridge_pciehdr_offset + 0x10) / 4; | 1721 | (pcipriv->ndis_adapter.pcibridge_pciehdr_offset + 0x10) / 4; |
1544 | 1722 | ||
@@ -1621,6 +1799,11 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev, | |||
1621 | pcipriv = (void *)rtlpriv->priv; | 1799 | pcipriv = (void *)rtlpriv->priv; |
1622 | pcipriv->dev.pdev = pdev; | 1800 | pcipriv->dev.pdev = pdev; |
1623 | 1801 | ||
1802 | /* init cfg & intf_ops */ | ||
1803 | rtlpriv->rtlhal.interface = INTF_PCI; | ||
1804 | rtlpriv->cfg = (struct rtl_hal_cfg *)(id->driver_data); | ||
1805 | rtlpriv->intf_ops = &rtl_pci_ops; | ||
1806 | |||
1624 | /* | 1807 | /* |
1625 | *init dbgp flags before all | 1808 | *init dbgp flags before all |
1626 | *other functions, because we will | 1809 | *other functions, because we will |
@@ -1638,13 +1821,14 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev, | |||
1638 | return err; | 1821 | return err; |
1639 | } | 1822 | } |
1640 | 1823 | ||
1641 | pmem_start = pci_resource_start(pdev, 2); | 1824 | pmem_start = pci_resource_start(pdev, rtlpriv->cfg->bar_id); |
1642 | pmem_len = pci_resource_len(pdev, 2); | 1825 | pmem_len = pci_resource_len(pdev, rtlpriv->cfg->bar_id); |
1643 | pmem_flags = pci_resource_flags(pdev, 2); | 1826 | pmem_flags = pci_resource_flags(pdev, rtlpriv->cfg->bar_id); |
1644 | 1827 | ||
1645 | /*shared mem start */ | 1828 | /*shared mem start */ |
1646 | rtlpriv->io.pci_mem_start = | 1829 | rtlpriv->io.pci_mem_start = |
1647 | (unsigned long)pci_iomap(pdev, 2, pmem_len); | 1830 | (unsigned long)pci_iomap(pdev, |
1831 | rtlpriv->cfg->bar_id, pmem_len); | ||
1648 | if (rtlpriv->io.pci_mem_start == 0) { | 1832 | if (rtlpriv->io.pci_mem_start == 0) { |
1649 | RT_ASSERT(false, ("Can't map PCI mem\n")); | 1833 | RT_ASSERT(false, ("Can't map PCI mem\n")); |
1650 | goto fail2; | 1834 | goto fail2; |
@@ -1663,11 +1847,6 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev, | |||
1663 | pci_write_config_byte(pdev, 0x04, 0x06); | 1847 | pci_write_config_byte(pdev, 0x04, 0x06); |
1664 | pci_write_config_byte(pdev, 0x04, 0x07); | 1848 | pci_write_config_byte(pdev, 0x04, 0x07); |
1665 | 1849 | ||
1666 | /* init cfg & intf_ops */ | ||
1667 | rtlpriv->rtlhal.interface = INTF_PCI; | ||
1668 | rtlpriv->cfg = (struct rtl_hal_cfg *)(id->driver_data); | ||
1669 | rtlpriv->intf_ops = &rtl_pci_ops; | ||
1670 | |||
1671 | /* find adapter */ | 1850 | /* find adapter */ |
1672 | _rtl_pci_find_adapter(pdev, hw); | 1851 | _rtl_pci_find_adapter(pdev, hw); |
1673 | 1852 | ||
@@ -1785,8 +1964,6 @@ void rtl_pci_disconnect(struct pci_dev *pdev) | |||
1785 | 1964 | ||
1786 | rtl_pci_deinit(hw); | 1965 | rtl_pci_deinit(hw); |
1787 | rtl_deinit_core(hw); | 1966 | rtl_deinit_core(hw); |
1788 | if (rtlpriv->cfg->ops->deinit_sw_leds) | ||
1789 | rtlpriv->cfg->ops->deinit_sw_leds(hw); | ||
1790 | _rtl_pci_io_handler_release(hw); | 1967 | _rtl_pci_io_handler_release(hw); |
1791 | rtlpriv->cfg->ops->deinit_sw_vars(hw); | 1968 | rtlpriv->cfg->ops->deinit_sw_vars(hw); |
1792 | 1969 | ||
@@ -1801,6 +1978,9 @@ void rtl_pci_disconnect(struct pci_dev *pdev) | |||
1801 | } | 1978 | } |
1802 | 1979 | ||
1803 | pci_disable_device(pdev); | 1980 | pci_disable_device(pdev); |
1981 | |||
1982 | rtl_pci_disable_aspm(hw); | ||
1983 | |||
1804 | pci_set_drvdata(pdev, NULL); | 1984 | pci_set_drvdata(pdev, NULL); |
1805 | 1985 | ||
1806 | ieee80211_free_hw(hw); | 1986 | ieee80211_free_hw(hw); |
@@ -1824,10 +2004,15 @@ no need to call hw_disable here. | |||
1824 | ****************************************/ | 2004 | ****************************************/ |
1825 | int rtl_pci_suspend(struct pci_dev *pdev, pm_message_t state) | 2005 | int rtl_pci_suspend(struct pci_dev *pdev, pm_message_t state) |
1826 | { | 2006 | { |
2007 | struct ieee80211_hw *hw = pci_get_drvdata(pdev); | ||
2008 | struct rtl_priv *rtlpriv = rtl_priv(hw); | ||
2009 | |||
2010 | rtlpriv->cfg->ops->hw_suspend(hw); | ||
2011 | rtl_deinit_rfkill(hw); | ||
2012 | |||
1827 | pci_save_state(pdev); | 2013 | pci_save_state(pdev); |
1828 | pci_disable_device(pdev); | 2014 | pci_disable_device(pdev); |
1829 | pci_set_power_state(pdev, PCI_D3hot); | 2015 | pci_set_power_state(pdev, PCI_D3hot); |
1830 | |||
1831 | return 0; | 2016 | return 0; |
1832 | } | 2017 | } |
1833 | EXPORT_SYMBOL(rtl_pci_suspend); | 2018 | EXPORT_SYMBOL(rtl_pci_suspend); |
@@ -1835,6 +2020,8 @@ EXPORT_SYMBOL(rtl_pci_suspend); | |||
1835 | int rtl_pci_resume(struct pci_dev *pdev) | 2020 | int rtl_pci_resume(struct pci_dev *pdev) |
1836 | { | 2021 | { |
1837 | int ret; | 2022 | int ret; |
2023 | struct ieee80211_hw *hw = pci_get_drvdata(pdev); | ||
2024 | struct rtl_priv *rtlpriv = rtl_priv(hw); | ||
1838 | 2025 | ||
1839 | pci_set_power_state(pdev, PCI_D0); | 2026 | pci_set_power_state(pdev, PCI_D0); |
1840 | ret = pci_enable_device(pdev); | 2027 | ret = pci_enable_device(pdev); |
@@ -1845,15 +2032,20 @@ int rtl_pci_resume(struct pci_dev *pdev) | |||
1845 | 2032 | ||
1846 | pci_restore_state(pdev); | 2033 | pci_restore_state(pdev); |
1847 | 2034 | ||
2035 | rtlpriv->cfg->ops->hw_resume(hw); | ||
2036 | rtl_init_rfkill(hw); | ||
1848 | return 0; | 2037 | return 0; |
1849 | } | 2038 | } |
1850 | EXPORT_SYMBOL(rtl_pci_resume); | 2039 | EXPORT_SYMBOL(rtl_pci_resume); |
1851 | 2040 | ||
1852 | struct rtl_intf_ops rtl_pci_ops = { | 2041 | struct rtl_intf_ops rtl_pci_ops = { |
2042 | .read_efuse_byte = read_efuse_byte, | ||
1853 | .adapter_start = rtl_pci_start, | 2043 | .adapter_start = rtl_pci_start, |
1854 | .adapter_stop = rtl_pci_stop, | 2044 | .adapter_stop = rtl_pci_stop, |
1855 | .adapter_tx = rtl_pci_tx, | 2045 | .adapter_tx = rtl_pci_tx, |
2046 | .flush = rtl_pci_flush, | ||
1856 | .reset_trx_ring = rtl_pci_reset_trx_ring, | 2047 | .reset_trx_ring = rtl_pci_reset_trx_ring, |
2048 | .waitq_insert = rtl_pci_tx_chk_waitq_insert, | ||
1857 | 2049 | ||
1858 | .disable_aspm = rtl_pci_disable_aspm, | 2050 | .disable_aspm = rtl_pci_disable_aspm, |
1859 | .enable_aspm = rtl_pci_enable_aspm, | 2051 | .enable_aspm = rtl_pci_enable_aspm, |