diff options
author | David S. Miller <davem@davemloft.net> | 2012-04-12 19:41:23 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-12 19:41:23 -0400 |
commit | 011e3c63251be832d23df9f0697626ab7b354d02 (patch) | |
tree | 2cad5b58c274c93ae49d9b58fb15d784d4dfd78f /drivers/net | |
parent | c1412fce7eccae62b4de22494f6ab3ff8a90c0c6 (diff) | |
parent | ecca5c3acc0d0933d89abc44e60afb0cc8170e35 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/tile/tilepro.c | 77 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/main.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00dev.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/base.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/pci.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192de/sw.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/usb.c | 34 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/wifi.h | 6 | ||||
-rw-r--r-- | drivers/net/xen-netfront.c | 2 |
9 files changed, 87 insertions, 64 deletions
diff --git a/drivers/net/ethernet/tile/tilepro.c b/drivers/net/ethernet/tile/tilepro.c index 261356c2dc99..3d501ec7fad7 100644 --- a/drivers/net/ethernet/tile/tilepro.c +++ b/drivers/net/ethernet/tile/tilepro.c | |||
@@ -342,6 +342,21 @@ inline int __netio_fastio1(u32 fastio_index, u32 arg0) | |||
342 | } | 342 | } |
343 | 343 | ||
344 | 344 | ||
345 | static void tile_net_return_credit(struct tile_net_cpu *info) | ||
346 | { | ||
347 | struct tile_netio_queue *queue = &info->queue; | ||
348 | netio_queue_user_impl_t *qup = &queue->__user_part; | ||
349 | |||
350 | /* Return four credits after every fourth packet. */ | ||
351 | if (--qup->__receive_credit_remaining == 0) { | ||
352 | u32 interval = qup->__receive_credit_interval; | ||
353 | qup->__receive_credit_remaining = interval; | ||
354 | __netio_fastio_return_credits(qup->__fastio_index, interval); | ||
355 | } | ||
356 | } | ||
357 | |||
358 | |||
359 | |||
345 | /* | 360 | /* |
346 | * Provide a linux buffer to LIPP. | 361 | * Provide a linux buffer to LIPP. |
347 | */ | 362 | */ |
@@ -433,7 +448,7 @@ static bool tile_net_provide_needed_buffer(struct tile_net_cpu *info, | |||
433 | struct sk_buff **skb_ptr; | 448 | struct sk_buff **skb_ptr; |
434 | 449 | ||
435 | /* Request 96 extra bytes for alignment purposes. */ | 450 | /* Request 96 extra bytes for alignment purposes. */ |
436 | skb = netdev_alloc_skb(info->napi->dev, len + padding); | 451 | skb = netdev_alloc_skb(info->napi.dev, len + padding); |
437 | if (skb == NULL) | 452 | if (skb == NULL) |
438 | return false; | 453 | return false; |
439 | 454 | ||
@@ -864,19 +879,11 @@ static bool tile_net_poll_aux(struct tile_net_cpu *info, int index) | |||
864 | 879 | ||
865 | stats->rx_packets++; | 880 | stats->rx_packets++; |
866 | stats->rx_bytes += len; | 881 | stats->rx_bytes += len; |
867 | |||
868 | if (small) | ||
869 | info->num_needed_small_buffers++; | ||
870 | else | ||
871 | info->num_needed_large_buffers++; | ||
872 | } | 882 | } |
873 | 883 | ||
874 | /* Return four credits after every fourth packet. */ | 884 | /* ISSUE: It would be nice to defer this until the packet has */ |
875 | if (--qup->__receive_credit_remaining == 0) { | 885 | /* actually been processed. */ |
876 | u32 interval = qup->__receive_credit_interval; | 886 | tile_net_return_credit(info); |
877 | qup->__receive_credit_remaining = interval; | ||
878 | __netio_fastio_return_credits(qup->__fastio_index, interval); | ||
879 | } | ||
880 | 887 | ||
881 | /* Consume this packet. */ | 888 | /* Consume this packet. */ |
882 | qup->__packet_receive_read = index2; | 889 | qup->__packet_receive_read = index2; |
@@ -1543,7 +1550,7 @@ static int tile_net_drain_lipp_buffers(struct tile_net_priv *priv) | |||
1543 | 1550 | ||
1544 | /* Drain all the LIPP buffers. */ | 1551 | /* Drain all the LIPP buffers. */ |
1545 | while (true) { | 1552 | while (true) { |
1546 | int buffer; | 1553 | unsigned int buffer; |
1547 | 1554 | ||
1548 | /* NOTE: This should never fail. */ | 1555 | /* NOTE: This should never fail. */ |
1549 | if (hv_dev_pread(priv->hv_devhdl, 0, (HV_VirtAddr)&buffer, | 1556 | if (hv_dev_pread(priv->hv_devhdl, 0, (HV_VirtAddr)&buffer, |
@@ -1707,7 +1714,7 @@ static unsigned int tile_net_tx_frags(lepp_frag_t *frags, | |||
1707 | if (!hash_default) { | 1714 | if (!hash_default) { |
1708 | void *va = pfn_to_kaddr(pfn) + f->page_offset; | 1715 | void *va = pfn_to_kaddr(pfn) + f->page_offset; |
1709 | BUG_ON(PageHighMem(skb_frag_page(f))); | 1716 | BUG_ON(PageHighMem(skb_frag_page(f))); |
1710 | finv_buffer_remote(va, f->size, 0); | 1717 | finv_buffer_remote(va, skb_frag_size(f), 0); |
1711 | } | 1718 | } |
1712 | 1719 | ||
1713 | cpa = ((phys_addr_t)pfn << PAGE_SHIFT) + f->page_offset; | 1720 | cpa = ((phys_addr_t)pfn << PAGE_SHIFT) + f->page_offset; |
@@ -1735,8 +1742,8 @@ static unsigned int tile_net_tx_frags(lepp_frag_t *frags, | |||
1735 | * Sometimes, if "sendfile()" requires copying, we will be called with | 1742 | * Sometimes, if "sendfile()" requires copying, we will be called with |
1736 | * "data" containing the header and payload, with "frags" being empty. | 1743 | * "data" containing the header and payload, with "frags" being empty. |
1737 | * | 1744 | * |
1738 | * In theory, "sh->nr_frags" could be 3, but in practice, it seems | 1745 | * Sometimes, for example when using NFS over TCP, a single segment can |
1739 | * that this will never actually happen. | 1746 | * span 3 fragments, which must be handled carefully in LEPP. |
1740 | * | 1747 | * |
1741 | * See "emulate_large_send_offload()" for some reference code, which | 1748 | * See "emulate_large_send_offload()" for some reference code, which |
1742 | * does not handle checksumming. | 1749 | * does not handle checksumming. |
@@ -1844,10 +1851,8 @@ static int tile_net_tx_tso(struct sk_buff *skb, struct net_device *dev) | |||
1844 | 1851 | ||
1845 | spin_lock_irqsave(&priv->eq_lock, irqflags); | 1852 | spin_lock_irqsave(&priv->eq_lock, irqflags); |
1846 | 1853 | ||
1847 | /* | 1854 | /* Handle completions if needed to make room. */ |
1848 | * Handle completions if needed to make room. | 1855 | /* NOTE: Return NETDEV_TX_BUSY if there is still no room. */ |
1849 | * HACK: Spin until there is sufficient room. | ||
1850 | */ | ||
1851 | if (lepp_num_free_comp_slots(eq) == 0) { | 1856 | if (lepp_num_free_comp_slots(eq) == 0) { |
1852 | nolds = tile_net_lepp_grab_comps(eq, olds, wanted, 0); | 1857 | nolds = tile_net_lepp_grab_comps(eq, olds, wanted, 0); |
1853 | if (nolds == 0) { | 1858 | if (nolds == 0) { |
@@ -1861,6 +1866,7 @@ busy: | |||
1861 | cmd_tail = eq->cmd_tail; | 1866 | cmd_tail = eq->cmd_tail; |
1862 | 1867 | ||
1863 | /* Prepare to advance, detecting full queue. */ | 1868 | /* Prepare to advance, detecting full queue. */ |
1869 | /* NOTE: Return NETDEV_TX_BUSY if the queue is full. */ | ||
1864 | cmd_next = cmd_tail + cmd_size; | 1870 | cmd_next = cmd_tail + cmd_size; |
1865 | if (cmd_tail < cmd_head && cmd_next >= cmd_head) | 1871 | if (cmd_tail < cmd_head && cmd_next >= cmd_head) |
1866 | goto busy; | 1872 | goto busy; |
@@ -2023,10 +2029,8 @@ static int tile_net_tx(struct sk_buff *skb, struct net_device *dev) | |||
2023 | 2029 | ||
2024 | spin_lock_irqsave(&priv->eq_lock, irqflags); | 2030 | spin_lock_irqsave(&priv->eq_lock, irqflags); |
2025 | 2031 | ||
2026 | /* | 2032 | /* Handle completions if needed to make room. */ |
2027 | * Handle completions if needed to make room. | 2033 | /* NOTE: Return NETDEV_TX_BUSY if there is still no room. */ |
2028 | * HACK: Spin until there is sufficient room. | ||
2029 | */ | ||
2030 | if (lepp_num_free_comp_slots(eq) == 0) { | 2034 | if (lepp_num_free_comp_slots(eq) == 0) { |
2031 | nolds = tile_net_lepp_grab_comps(eq, olds, wanted, 0); | 2035 | nolds = tile_net_lepp_grab_comps(eq, olds, wanted, 0); |
2032 | if (nolds == 0) { | 2036 | if (nolds == 0) { |
@@ -2040,6 +2044,7 @@ busy: | |||
2040 | cmd_tail = eq->cmd_tail; | 2044 | cmd_tail = eq->cmd_tail; |
2041 | 2045 | ||
2042 | /* Copy the commands, or fail. */ | 2046 | /* Copy the commands, or fail. */ |
2047 | /* NOTE: Return NETDEV_TX_BUSY if the queue is full. */ | ||
2043 | for (i = 0; i < num_frags; i++) { | 2048 | for (i = 0; i < num_frags; i++) { |
2044 | 2049 | ||
2045 | /* Prepare to advance, detecting full queue. */ | 2050 | /* Prepare to advance, detecting full queue. */ |
@@ -2261,6 +2266,23 @@ static int tile_net_get_mac(struct net_device *dev) | |||
2261 | return 0; | 2266 | return 0; |
2262 | } | 2267 | } |
2263 | 2268 | ||
2269 | |||
2270 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
2271 | /* | ||
2272 | * Polling 'interrupt' - used by things like netconsole to send skbs | ||
2273 | * without having to re-enable interrupts. It's not called while | ||
2274 | * the interrupt routine is executing. | ||
2275 | */ | ||
2276 | static void tile_net_netpoll(struct net_device *dev) | ||
2277 | { | ||
2278 | struct tile_net_priv *priv = netdev_priv(dev); | ||
2279 | disable_percpu_irq(priv->intr_id); | ||
2280 | tile_net_handle_ingress_interrupt(priv->intr_id, dev); | ||
2281 | enable_percpu_irq(priv->intr_id, 0); | ||
2282 | } | ||
2283 | #endif | ||
2284 | |||
2285 | |||
2264 | static const struct net_device_ops tile_net_ops = { | 2286 | static const struct net_device_ops tile_net_ops = { |
2265 | .ndo_open = tile_net_open, | 2287 | .ndo_open = tile_net_open, |
2266 | .ndo_stop = tile_net_stop, | 2288 | .ndo_stop = tile_net_stop, |
@@ -2269,7 +2291,10 @@ static const struct net_device_ops tile_net_ops = { | |||
2269 | .ndo_get_stats = tile_net_get_stats, | 2291 | .ndo_get_stats = tile_net_get_stats, |
2270 | .ndo_change_mtu = tile_net_change_mtu, | 2292 | .ndo_change_mtu = tile_net_change_mtu, |
2271 | .ndo_tx_timeout = tile_net_tx_timeout, | 2293 | .ndo_tx_timeout = tile_net_tx_timeout, |
2272 | .ndo_set_mac_address = tile_net_set_mac_address | 2294 | .ndo_set_mac_address = tile_net_set_mac_address, |
2295 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
2296 | .ndo_poll_controller = tile_net_netpoll, | ||
2297 | #endif | ||
2273 | }; | 2298 | }; |
2274 | 2299 | ||
2275 | 2300 | ||
@@ -2409,7 +2434,7 @@ static void tile_net_cleanup(void) | |||
2409 | */ | 2434 | */ |
2410 | static int tile_net_init_module(void) | 2435 | static int tile_net_init_module(void) |
2411 | { | 2436 | { |
2412 | pr_info("Tilera IPP Net Driver\n"); | 2437 | pr_info("Tilera Network Driver\n"); |
2413 | 2438 | ||
2414 | tile_net_devs[0] = tile_net_dev_init("xgbe0"); | 2439 | tile_net_devs[0] = tile_net_dev_init("xgbe0"); |
2415 | tile_net_devs[1] = tile_net_dev_init("xgbe1"); | 2440 | tile_net_devs[1] = tile_net_dev_init("xgbe1"); |
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 215eb2536b1e..2504ab005589 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -118,15 +118,13 @@ void ath9k_ps_restore(struct ath_softc *sc) | |||
118 | if (--sc->ps_usecount != 0) | 118 | if (--sc->ps_usecount != 0) |
119 | goto unlock; | 119 | goto unlock; |
120 | 120 | ||
121 | if (sc->ps_flags & PS_WAIT_FOR_TX_ACK) | 121 | if (sc->ps_idle && (sc->ps_flags & PS_WAIT_FOR_TX_ACK)) |
122 | goto unlock; | ||
123 | |||
124 | if (sc->ps_idle) | ||
125 | mode = ATH9K_PM_FULL_SLEEP; | 122 | mode = ATH9K_PM_FULL_SLEEP; |
126 | else if (sc->ps_enabled && | 123 | else if (sc->ps_enabled && |
127 | !(sc->ps_flags & (PS_WAIT_FOR_BEACON | | 124 | !(sc->ps_flags & (PS_WAIT_FOR_BEACON | |
128 | PS_WAIT_FOR_CAB | | 125 | PS_WAIT_FOR_CAB | |
129 | PS_WAIT_FOR_PSPOLL_DATA))) | 126 | PS_WAIT_FOR_PSPOLL_DATA | |
127 | PS_WAIT_FOR_TX_ACK))) | ||
130 | mode = ATH9K_PM_NETWORK_SLEEP; | 128 | mode = ATH9K_PM_NETWORK_SLEEP; |
131 | else | 129 | else |
132 | goto unlock; | 130 | goto unlock; |
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index fc9901e027c1..90cc5e772650 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -1062,11 +1062,6 @@ static int rt2x00lib_initialize(struct rt2x00_dev *rt2x00dev) | |||
1062 | 1062 | ||
1063 | set_bit(DEVICE_STATE_INITIALIZED, &rt2x00dev->flags); | 1063 | set_bit(DEVICE_STATE_INITIALIZED, &rt2x00dev->flags); |
1064 | 1064 | ||
1065 | /* | ||
1066 | * Register the extra components. | ||
1067 | */ | ||
1068 | rt2x00rfkill_register(rt2x00dev); | ||
1069 | |||
1070 | return 0; | 1065 | return 0; |
1071 | } | 1066 | } |
1072 | 1067 | ||
@@ -1210,6 +1205,7 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev) | |||
1210 | rt2x00link_register(rt2x00dev); | 1205 | rt2x00link_register(rt2x00dev); |
1211 | rt2x00leds_register(rt2x00dev); | 1206 | rt2x00leds_register(rt2x00dev); |
1212 | rt2x00debug_register(rt2x00dev); | 1207 | rt2x00debug_register(rt2x00dev); |
1208 | rt2x00rfkill_register(rt2x00dev); | ||
1213 | 1209 | ||
1214 | return 0; | 1210 | return 0; |
1215 | 1211 | ||
diff --git a/drivers/net/wireless/rtlwifi/base.c b/drivers/net/wireless/rtlwifi/base.c index 510023554e5f..e54488db0e10 100644 --- a/drivers/net/wireless/rtlwifi/base.c +++ b/drivers/net/wireless/rtlwifi/base.c | |||
@@ -838,7 +838,10 @@ void rtl_get_tcb_desc(struct ieee80211_hw *hw, | |||
838 | __le16 fc = hdr->frame_control; | 838 | __le16 fc = hdr->frame_control; |
839 | 839 | ||
840 | txrate = ieee80211_get_tx_rate(hw, info); | 840 | txrate = ieee80211_get_tx_rate(hw, info); |
841 | tcb_desc->hw_rate = txrate->hw_value; | 841 | if (txrate) |
842 | tcb_desc->hw_rate = txrate->hw_value; | ||
843 | else | ||
844 | tcb_desc->hw_rate = 0; | ||
842 | 845 | ||
843 | if (ieee80211_is_data(fc)) { | 846 | if (ieee80211_is_data(fc)) { |
844 | /* | 847 | /* |
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c index 07dd38efe62a..288b035a3579 100644 --- a/drivers/net/wireless/rtlwifi/pci.c +++ b/drivers/net/wireless/rtlwifi/pci.c | |||
@@ -912,8 +912,13 @@ static void _rtl_pci_prepare_bcn_tasklet(struct ieee80211_hw *hw) | |||
912 | memset(&tcb_desc, 0, sizeof(struct rtl_tcb_desc)); | 912 | memset(&tcb_desc, 0, sizeof(struct rtl_tcb_desc)); |
913 | ring = &rtlpci->tx_ring[BEACON_QUEUE]; | 913 | ring = &rtlpci->tx_ring[BEACON_QUEUE]; |
914 | pskb = __skb_dequeue(&ring->queue); | 914 | pskb = __skb_dequeue(&ring->queue); |
915 | if (pskb) | 915 | if (pskb) { |
916 | struct rtl_tx_desc *entry = &ring->desc[ring->idx]; | ||
917 | pci_unmap_single(rtlpci->pdev, rtlpriv->cfg->ops->get_desc( | ||
918 | (u8 *) entry, true, HW_DESC_TXBUFF_ADDR), | ||
919 | pskb->len, PCI_DMA_TODEVICE); | ||
916 | kfree_skb(pskb); | 920 | kfree_skb(pskb); |
921 | } | ||
917 | 922 | ||
918 | /*NB: the beacon data buffer must be 32-bit aligned. */ | 923 | /*NB: the beacon data buffer must be 32-bit aligned. */ |
919 | pskb = ieee80211_beacon_get(hw, mac->vif); | 924 | pskb = ieee80211_beacon_get(hw, mac->vif); |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/sw.c b/drivers/net/wireless/rtlwifi/rtl8192de/sw.c index 4898c502974d..480862c07f92 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192de/sw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192de/sw.c | |||
@@ -91,7 +91,6 @@ static int rtl92d_init_sw_vars(struct ieee80211_hw *hw) | |||
91 | u8 tid; | 91 | u8 tid; |
92 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 92 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
93 | struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); | 93 | struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); |
94 | static int header_print; | ||
95 | 94 | ||
96 | rtlpriv->dm.dm_initialgain_enable = true; | 95 | rtlpriv->dm.dm_initialgain_enable = true; |
97 | rtlpriv->dm.dm_flag = 0; | 96 | rtlpriv->dm.dm_flag = 0; |
@@ -171,10 +170,6 @@ static int rtl92d_init_sw_vars(struct ieee80211_hw *hw) | |||
171 | for (tid = 0; tid < 8; tid++) | 170 | for (tid = 0; tid < 8; tid++) |
172 | skb_queue_head_init(&rtlpriv->mac80211.skb_waitq[tid]); | 171 | skb_queue_head_init(&rtlpriv->mac80211.skb_waitq[tid]); |
173 | 172 | ||
174 | /* Only load firmware for first MAC */ | ||
175 | if (header_print) | ||
176 | return 0; | ||
177 | |||
178 | /* for firmware buf */ | 173 | /* for firmware buf */ |
179 | rtlpriv->rtlhal.pfirmware = vzalloc(0x8000); | 174 | rtlpriv->rtlhal.pfirmware = vzalloc(0x8000); |
180 | if (!rtlpriv->rtlhal.pfirmware) { | 175 | if (!rtlpriv->rtlhal.pfirmware) { |
@@ -186,7 +181,6 @@ static int rtl92d_init_sw_vars(struct ieee80211_hw *hw) | |||
186 | rtlpriv->max_fw_size = 0x8000; | 181 | rtlpriv->max_fw_size = 0x8000; |
187 | pr_info("Driver for Realtek RTL8192DE WLAN interface\n"); | 182 | pr_info("Driver for Realtek RTL8192DE WLAN interface\n"); |
188 | pr_info("Loading firmware file %s\n", rtlpriv->cfg->fw_name); | 183 | pr_info("Loading firmware file %s\n", rtlpriv->cfg->fw_name); |
189 | header_print++; | ||
190 | 184 | ||
191 | /* request fw */ | 185 | /* request fw */ |
192 | err = request_firmware_nowait(THIS_MODULE, 1, rtlpriv->cfg->fw_name, | 186 | err = request_firmware_nowait(THIS_MODULE, 1, rtlpriv->cfg->fw_name, |
diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c index 2e1e352864bb..d04dbda13f5a 100644 --- a/drivers/net/wireless/rtlwifi/usb.c +++ b/drivers/net/wireless/rtlwifi/usb.c | |||
@@ -124,46 +124,38 @@ static int _usbctrl_vendorreq_sync_read(struct usb_device *udev, u8 request, | |||
124 | return status; | 124 | return status; |
125 | } | 125 | } |
126 | 126 | ||
127 | static u32 _usb_read_sync(struct usb_device *udev, u32 addr, u16 len) | 127 | static u32 _usb_read_sync(struct rtl_priv *rtlpriv, u32 addr, u16 len) |
128 | { | 128 | { |
129 | struct device *dev = rtlpriv->io.dev; | ||
130 | struct usb_device *udev = to_usb_device(dev); | ||
129 | u8 request; | 131 | u8 request; |
130 | u16 wvalue; | 132 | u16 wvalue; |
131 | u16 index; | 133 | u16 index; |
132 | u32 *data; | 134 | __le32 *data = &rtlpriv->usb_data[rtlpriv->usb_data_index]; |
133 | u32 ret; | ||
134 | 135 | ||
135 | data = kmalloc(sizeof(u32), GFP_KERNEL); | ||
136 | if (!data) | ||
137 | return -ENOMEM; | ||
138 | request = REALTEK_USB_VENQT_CMD_REQ; | 136 | request = REALTEK_USB_VENQT_CMD_REQ; |
139 | index = REALTEK_USB_VENQT_CMD_IDX; /* n/a */ | 137 | index = REALTEK_USB_VENQT_CMD_IDX; /* n/a */ |
140 | 138 | ||
141 | wvalue = (u16)addr; | 139 | wvalue = (u16)addr; |
142 | _usbctrl_vendorreq_sync_read(udev, request, wvalue, index, data, len); | 140 | _usbctrl_vendorreq_sync_read(udev, request, wvalue, index, data, len); |
143 | ret = le32_to_cpu(*data); | 141 | if (++rtlpriv->usb_data_index >= RTL_USB_MAX_RX_COUNT) |
144 | kfree(data); | 142 | rtlpriv->usb_data_index = 0; |
145 | return ret; | 143 | return le32_to_cpu(*data); |
146 | } | 144 | } |
147 | 145 | ||
148 | static u8 _usb_read8_sync(struct rtl_priv *rtlpriv, u32 addr) | 146 | static u8 _usb_read8_sync(struct rtl_priv *rtlpriv, u32 addr) |
149 | { | 147 | { |
150 | struct device *dev = rtlpriv->io.dev; | 148 | return (u8)_usb_read_sync(rtlpriv, addr, 1); |
151 | |||
152 | return (u8)_usb_read_sync(to_usb_device(dev), addr, 1); | ||
153 | } | 149 | } |
154 | 150 | ||
155 | static u16 _usb_read16_sync(struct rtl_priv *rtlpriv, u32 addr) | 151 | static u16 _usb_read16_sync(struct rtl_priv *rtlpriv, u32 addr) |
156 | { | 152 | { |
157 | struct device *dev = rtlpriv->io.dev; | 153 | return (u16)_usb_read_sync(rtlpriv, addr, 2); |
158 | |||
159 | return (u16)_usb_read_sync(to_usb_device(dev), addr, 2); | ||
160 | } | 154 | } |
161 | 155 | ||
162 | static u32 _usb_read32_sync(struct rtl_priv *rtlpriv, u32 addr) | 156 | static u32 _usb_read32_sync(struct rtl_priv *rtlpriv, u32 addr) |
163 | { | 157 | { |
164 | struct device *dev = rtlpriv->io.dev; | 158 | return _usb_read_sync(rtlpriv, addr, 4); |
165 | |||
166 | return _usb_read_sync(to_usb_device(dev), addr, 4); | ||
167 | } | 159 | } |
168 | 160 | ||
169 | static void _usb_write_async(struct usb_device *udev, u32 addr, u32 val, | 161 | static void _usb_write_async(struct usb_device *udev, u32 addr, u32 val, |
@@ -955,6 +947,11 @@ int __devinit rtl_usb_probe(struct usb_interface *intf, | |||
955 | return -ENOMEM; | 947 | return -ENOMEM; |
956 | } | 948 | } |
957 | rtlpriv = hw->priv; | 949 | rtlpriv = hw->priv; |
950 | rtlpriv->usb_data = kzalloc(RTL_USB_MAX_RX_COUNT * sizeof(u32), | ||
951 | GFP_KERNEL); | ||
952 | if (!rtlpriv->usb_data) | ||
953 | return -ENOMEM; | ||
954 | rtlpriv->usb_data_index = 0; | ||
958 | init_completion(&rtlpriv->firmware_loading_complete); | 955 | init_completion(&rtlpriv->firmware_loading_complete); |
959 | SET_IEEE80211_DEV(hw, &intf->dev); | 956 | SET_IEEE80211_DEV(hw, &intf->dev); |
960 | udev = interface_to_usbdev(intf); | 957 | udev = interface_to_usbdev(intf); |
@@ -1025,6 +1022,7 @@ void rtl_usb_disconnect(struct usb_interface *intf) | |||
1025 | /* rtl_deinit_rfkill(hw); */ | 1022 | /* rtl_deinit_rfkill(hw); */ |
1026 | rtl_usb_deinit(hw); | 1023 | rtl_usb_deinit(hw); |
1027 | rtl_deinit_core(hw); | 1024 | rtl_deinit_core(hw); |
1025 | kfree(rtlpriv->usb_data); | ||
1028 | rtlpriv->cfg->ops->deinit_sw_leds(hw); | 1026 | rtlpriv->cfg->ops->deinit_sw_leds(hw); |
1029 | rtlpriv->cfg->ops->deinit_sw_vars(hw); | 1027 | rtlpriv->cfg->ops->deinit_sw_vars(hw); |
1030 | _rtl_usb_io_handler_release(hw); | 1028 | _rtl_usb_io_handler_release(hw); |
diff --git a/drivers/net/wireless/rtlwifi/wifi.h b/drivers/net/wireless/rtlwifi/wifi.h index b591614c3b9b..28ebc69218a3 100644 --- a/drivers/net/wireless/rtlwifi/wifi.h +++ b/drivers/net/wireless/rtlwifi/wifi.h | |||
@@ -67,7 +67,7 @@ | |||
67 | #define QOS_QUEUE_NUM 4 | 67 | #define QOS_QUEUE_NUM 4 |
68 | #define RTL_MAC80211_NUM_QUEUE 5 | 68 | #define RTL_MAC80211_NUM_QUEUE 5 |
69 | #define REALTEK_USB_VENQT_MAX_BUF_SIZE 254 | 69 | #define REALTEK_USB_VENQT_MAX_BUF_SIZE 254 |
70 | 70 | #define RTL_USB_MAX_RX_COUNT 100 | |
71 | #define QBSS_LOAD_SIZE 5 | 71 | #define QBSS_LOAD_SIZE 5 |
72 | #define MAX_WMMELE_LENGTH 64 | 72 | #define MAX_WMMELE_LENGTH 64 |
73 | 73 | ||
@@ -1629,6 +1629,10 @@ struct rtl_priv { | |||
1629 | interface or hardware */ | 1629 | interface or hardware */ |
1630 | unsigned long status; | 1630 | unsigned long status; |
1631 | 1631 | ||
1632 | /* data buffer pointer for USB reads */ | ||
1633 | __le32 *usb_data; | ||
1634 | int usb_data_index; | ||
1635 | |||
1632 | /*This must be the last item so | 1636 | /*This must be the last item so |
1633 | that it points to the data allocated | 1637 | that it points to the data allocated |
1634 | beyond this structure like: | 1638 | beyond this structure like: |
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index 663b32c2e931..0ebbb1906c30 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c | |||
@@ -1965,7 +1965,7 @@ static int __init netif_init(void) | |||
1965 | if (xen_initial_domain()) | 1965 | if (xen_initial_domain()) |
1966 | return 0; | 1966 | return 0; |
1967 | 1967 | ||
1968 | if (!xen_platform_pci_unplug) | 1968 | if (xen_hvm_domain() && !xen_platform_pci_unplug) |
1969 | return -ENODEV; | 1969 | return -ENODEV; |
1970 | 1970 | ||
1971 | printk(KERN_INFO "Initialising Xen virtual ethernet driver.\n"); | 1971 | printk(KERN_INFO "Initialising Xen virtual ethernet driver.\n"); |