diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-02-28 23:57:20 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-02-28 23:57:20 -0500 |
commit | 96789ac4b3943fec27fb6bf2713633b01a3903ad (patch) | |
tree | 5fa9dce4561072e64e460c8d920851a63a3b0b98 | |
parent | 77eebf346dfe87587ee8a54c76349a996e80c24f (diff) | |
parent | 958ddb75b04b792c701b2b08acdb200d638abf4e (diff) |
Merge branch 'upstream-fixes' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
-rw-r--r-- | drivers/net/8139cp.c | 37 | ||||
-rw-r--r-- | drivers/net/sky2.c | 77 | ||||
-rw-r--r-- | drivers/net/sky2.h | 1 | ||||
-rw-r--r-- | drivers/net/via-velocity.c | 3 | ||||
-rw-r--r-- | net/ieee80211/ieee80211_rx.c | 16 |
5 files changed, 29 insertions, 105 deletions
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c index f822cd3025ff..dd410496aadb 100644 --- a/drivers/net/8139cp.c +++ b/drivers/net/8139cp.c | |||
@@ -1118,13 +1118,18 @@ err_out: | |||
1118 | return -ENOMEM; | 1118 | return -ENOMEM; |
1119 | } | 1119 | } |
1120 | 1120 | ||
1121 | static void cp_init_rings_index (struct cp_private *cp) | ||
1122 | { | ||
1123 | cp->rx_tail = 0; | ||
1124 | cp->tx_head = cp->tx_tail = 0; | ||
1125 | } | ||
1126 | |||
1121 | static int cp_init_rings (struct cp_private *cp) | 1127 | static int cp_init_rings (struct cp_private *cp) |
1122 | { | 1128 | { |
1123 | memset(cp->tx_ring, 0, sizeof(struct cp_desc) * CP_TX_RING_SIZE); | 1129 | memset(cp->tx_ring, 0, sizeof(struct cp_desc) * CP_TX_RING_SIZE); |
1124 | cp->tx_ring[CP_TX_RING_SIZE - 1].opts1 = cpu_to_le32(RingEnd); | 1130 | cp->tx_ring[CP_TX_RING_SIZE - 1].opts1 = cpu_to_le32(RingEnd); |
1125 | 1131 | ||
1126 | cp->rx_tail = 0; | 1132 | cp_init_rings_index(cp); |
1127 | cp->tx_head = cp->tx_tail = 0; | ||
1128 | 1133 | ||
1129 | return cp_refill_rx (cp); | 1134 | return cp_refill_rx (cp); |
1130 | } | 1135 | } |
@@ -1886,30 +1891,30 @@ static int cp_suspend (struct pci_dev *pdev, pm_message_t state) | |||
1886 | 1891 | ||
1887 | spin_unlock_irqrestore (&cp->lock, flags); | 1892 | spin_unlock_irqrestore (&cp->lock, flags); |
1888 | 1893 | ||
1889 | if (cp->pdev && cp->wol_enabled) { | 1894 | pci_save_state(pdev); |
1890 | pci_save_state (cp->pdev); | 1895 | pci_enable_wake(pdev, pci_choose_state(pdev, state), cp->wol_enabled); |
1891 | cp_set_d3_state (cp); | 1896 | pci_set_power_state(pdev, pci_choose_state(pdev, state)); |
1892 | } | ||
1893 | 1897 | ||
1894 | return 0; | 1898 | return 0; |
1895 | } | 1899 | } |
1896 | 1900 | ||
1897 | static int cp_resume (struct pci_dev *pdev) | 1901 | static int cp_resume (struct pci_dev *pdev) |
1898 | { | 1902 | { |
1899 | struct net_device *dev; | 1903 | struct net_device *dev = pci_get_drvdata (pdev); |
1900 | struct cp_private *cp; | 1904 | struct cp_private *cp = netdev_priv(dev); |
1901 | unsigned long flags; | 1905 | unsigned long flags; |
1902 | 1906 | ||
1903 | dev = pci_get_drvdata (pdev); | 1907 | if (!netif_running(dev)) |
1904 | cp = netdev_priv(dev); | 1908 | return 0; |
1905 | 1909 | ||
1906 | netif_device_attach (dev); | 1910 | netif_device_attach (dev); |
1907 | 1911 | ||
1908 | if (cp->pdev && cp->wol_enabled) { | 1912 | pci_set_power_state(pdev, PCI_D0); |
1909 | pci_set_power_state (cp->pdev, PCI_D0); | 1913 | pci_restore_state(pdev); |
1910 | pci_restore_state (cp->pdev); | 1914 | pci_enable_wake(pdev, PCI_D0, 0); |
1911 | } | 1915 | |
1912 | 1916 | /* FIXME: sh*t may happen if the Rx ring buffer is depleted */ | |
1917 | cp_init_rings_index (cp); | ||
1913 | cp_init_hw (cp); | 1918 | cp_init_hw (cp); |
1914 | netif_start_queue (dev); | 1919 | netif_start_queue (dev); |
1915 | 1920 | ||
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index ca8160d68229..72c1630977d6 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -96,10 +96,6 @@ static int copybreak __read_mostly = 256; | |||
96 | module_param(copybreak, int, 0); | 96 | module_param(copybreak, int, 0); |
97 | MODULE_PARM_DESC(copybreak, "Receive copy threshold"); | 97 | MODULE_PARM_DESC(copybreak, "Receive copy threshold"); |
98 | 98 | ||
99 | static int disable_msi = 0; | ||
100 | module_param(disable_msi, int, 0); | ||
101 | MODULE_PARM_DESC(disable_msi, "Disable Message Signaled Interrupt (MSI)"); | ||
102 | |||
103 | static const struct pci_device_id sky2_id_table[] = { | 99 | static const struct pci_device_id sky2_id_table[] = { |
104 | { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9000) }, | 100 | { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9000) }, |
105 | { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9E00) }, | 101 | { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9E00) }, |
@@ -3126,61 +3122,6 @@ static void __devinit sky2_show_addr(struct net_device *dev) | |||
3126 | dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]); | 3122 | dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]); |
3127 | } | 3123 | } |
3128 | 3124 | ||
3129 | /* Handle software interrupt used during MSI test */ | ||
3130 | static irqreturn_t __devinit sky2_test_intr(int irq, void *dev_id, | ||
3131 | struct pt_regs *regs) | ||
3132 | { | ||
3133 | struct sky2_hw *hw = dev_id; | ||
3134 | u32 status = sky2_read32(hw, B0_Y2_SP_ISRC2); | ||
3135 | |||
3136 | if (status == 0) | ||
3137 | return IRQ_NONE; | ||
3138 | |||
3139 | if (status & Y2_IS_IRQ_SW) { | ||
3140 | sky2_write8(hw, B0_CTST, CS_CL_SW_IRQ); | ||
3141 | hw->msi = 1; | ||
3142 | } | ||
3143 | sky2_write32(hw, B0_Y2_SP_ICR, 2); | ||
3144 | |||
3145 | sky2_read32(hw, B0_IMSK); | ||
3146 | return IRQ_HANDLED; | ||
3147 | } | ||
3148 | |||
3149 | /* Test interrupt path by forcing a a software IRQ */ | ||
3150 | static int __devinit sky2_test_msi(struct sky2_hw *hw) | ||
3151 | { | ||
3152 | struct pci_dev *pdev = hw->pdev; | ||
3153 | int i, err; | ||
3154 | |||
3155 | sky2_write32(hw, B0_IMSK, Y2_IS_IRQ_SW); | ||
3156 | |||
3157 | err = request_irq(pdev->irq, sky2_test_intr, SA_SHIRQ, DRV_NAME, hw); | ||
3158 | if (err) { | ||
3159 | printk(KERN_ERR PFX "%s: cannot assign irq %d\n", | ||
3160 | pci_name(pdev), pdev->irq); | ||
3161 | return err; | ||
3162 | } | ||
3163 | |||
3164 | sky2_write8(hw, B0_CTST, CS_ST_SW_IRQ); | ||
3165 | wmb(); | ||
3166 | |||
3167 | for (i = 0; i < 10; i++) { | ||
3168 | barrier(); | ||
3169 | if (hw->msi) | ||
3170 | goto found; | ||
3171 | mdelay(1); | ||
3172 | } | ||
3173 | |||
3174 | err = -EOPNOTSUPP; | ||
3175 | sky2_write8(hw, B0_CTST, CS_CL_SW_IRQ); | ||
3176 | found: | ||
3177 | sky2_write32(hw, B0_IMSK, 0); | ||
3178 | |||
3179 | free_irq(pdev->irq, hw); | ||
3180 | |||
3181 | return err; | ||
3182 | } | ||
3183 | |||
3184 | static int __devinit sky2_probe(struct pci_dev *pdev, | 3125 | static int __devinit sky2_probe(struct pci_dev *pdev, |
3185 | const struct pci_device_id *ent) | 3126 | const struct pci_device_id *ent) |
3186 | { | 3127 | { |
@@ -3302,20 +3243,6 @@ static int __devinit sky2_probe(struct pci_dev *pdev, | |||
3302 | } | 3243 | } |
3303 | } | 3244 | } |
3304 | 3245 | ||
3305 | if (!disable_msi && pci_enable_msi(pdev) == 0) { | ||
3306 | err = sky2_test_msi(hw); | ||
3307 | if (err == -EOPNOTSUPP) { | ||
3308 | /* MSI test failed, go back to INTx mode */ | ||
3309 | printk(KERN_WARNING PFX "%s: No interrupt was generated using MSI, " | ||
3310 | "switching to INTx mode. Please report this failure to " | ||
3311 | "the PCI maintainer and include system chipset information.\n", | ||
3312 | pci_name(pdev)); | ||
3313 | pci_disable_msi(pdev); | ||
3314 | } | ||
3315 | else if (err) | ||
3316 | goto err_out_unregister; | ||
3317 | } | ||
3318 | |||
3319 | err = request_irq(pdev->irq, sky2_intr, SA_SHIRQ | SA_SAMPLE_RANDOM, | 3246 | err = request_irq(pdev->irq, sky2_intr, SA_SHIRQ | SA_SAMPLE_RANDOM, |
3320 | DRV_NAME, hw); | 3247 | DRV_NAME, hw); |
3321 | if (err) { | 3248 | if (err) { |
@@ -3332,8 +3259,6 @@ static int __devinit sky2_probe(struct pci_dev *pdev, | |||
3332 | return 0; | 3259 | return 0; |
3333 | 3260 | ||
3334 | err_out_unregister: | 3261 | err_out_unregister: |
3335 | if (hw->msi) | ||
3336 | pci_disable_msi(pdev); | ||
3337 | if (dev1) { | 3262 | if (dev1) { |
3338 | unregister_netdev(dev1); | 3263 | unregister_netdev(dev1); |
3339 | free_netdev(dev1); | 3264 | free_netdev(dev1); |
@@ -3376,8 +3301,6 @@ static void __devexit sky2_remove(struct pci_dev *pdev) | |||
3376 | sky2_read8(hw, B0_CTST); | 3301 | sky2_read8(hw, B0_CTST); |
3377 | 3302 | ||
3378 | free_irq(pdev->irq, hw); | 3303 | free_irq(pdev->irq, hw); |
3379 | if (hw->msi) | ||
3380 | pci_disable_msi(pdev); | ||
3381 | pci_free_consistent(pdev, STATUS_LE_BYTES, hw->st_le, hw->st_dma); | 3304 | pci_free_consistent(pdev, STATUS_LE_BYTES, hw->st_le, hw->st_dma); |
3382 | pci_release_regions(pdev); | 3305 | pci_release_regions(pdev); |
3383 | pci_disable_device(pdev); | 3306 | pci_disable_device(pdev); |
diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h index 3edb98075e0a..dce955c76f3c 100644 --- a/drivers/net/sky2.h +++ b/drivers/net/sky2.h | |||
@@ -1881,7 +1881,6 @@ struct sky2_hw { | |||
1881 | u32 intr_mask; | 1881 | u32 intr_mask; |
1882 | 1882 | ||
1883 | int pm_cap; | 1883 | int pm_cap; |
1884 | int msi; | ||
1885 | u8 chip_id; | 1884 | u8 chip_id; |
1886 | u8 chip_rev; | 1885 | u8 chip_rev; |
1887 | u8 copper; | 1886 | u8 copper; |
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index c2d5907dc8e0..ed1f837c8fda 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c | |||
@@ -1106,6 +1106,9 @@ static void velocity_free_rd_ring(struct velocity_info *vptr) | |||
1106 | 1106 | ||
1107 | for (i = 0; i < vptr->options.numrx; i++) { | 1107 | for (i = 0; i < vptr->options.numrx; i++) { |
1108 | struct velocity_rd_info *rd_info = &(vptr->rd_info[i]); | 1108 | struct velocity_rd_info *rd_info = &(vptr->rd_info[i]); |
1109 | struct rx_desc *rd = vptr->rd_ring + i; | ||
1110 | |||
1111 | memset(rd, 0, sizeof(*rd)); | ||
1109 | 1112 | ||
1110 | if (!rd_info->skb) | 1113 | if (!rd_info->skb) |
1111 | continue; | 1114 | continue; |
diff --git a/net/ieee80211/ieee80211_rx.c b/net/ieee80211/ieee80211_rx.c index 960aa78cdb97..b410ab8bcf7a 100644 --- a/net/ieee80211/ieee80211_rx.c +++ b/net/ieee80211/ieee80211_rx.c | |||
@@ -1301,7 +1301,7 @@ static void update_network(struct ieee80211_network *dst, | |||
1301 | /* dst->last_associate is not overwritten */ | 1301 | /* dst->last_associate is not overwritten */ |
1302 | } | 1302 | } |
1303 | 1303 | ||
1304 | static inline int is_beacon(int fc) | 1304 | static inline int is_beacon(__le16 fc) |
1305 | { | 1305 | { |
1306 | return (WLAN_FC_GET_STYPE(le16_to_cpu(fc)) == IEEE80211_STYPE_BEACON); | 1306 | return (WLAN_FC_GET_STYPE(le16_to_cpu(fc)) == IEEE80211_STYPE_BEACON); |
1307 | } | 1307 | } |
@@ -1348,9 +1348,7 @@ static void ieee80211_process_probe_response(struct ieee80211_device | |||
1348 | escape_essid(info_element->data, | 1348 | escape_essid(info_element->data, |
1349 | info_element->len), | 1349 | info_element->len), |
1350 | MAC_ARG(beacon->header.addr3), | 1350 | MAC_ARG(beacon->header.addr3), |
1351 | is_beacon(le16_to_cpu | 1351 | is_beacon(beacon->header.frame_ctl) ? |
1352 | (beacon->header. | ||
1353 | frame_ctl)) ? | ||
1354 | "BEACON" : "PROBE RESPONSE"); | 1352 | "BEACON" : "PROBE RESPONSE"); |
1355 | return; | 1353 | return; |
1356 | } | 1354 | } |
@@ -1400,9 +1398,7 @@ static void ieee80211_process_probe_response(struct ieee80211_device | |||
1400 | escape_essid(network.ssid, | 1398 | escape_essid(network.ssid, |
1401 | network.ssid_len), | 1399 | network.ssid_len), |
1402 | MAC_ARG(network.bssid), | 1400 | MAC_ARG(network.bssid), |
1403 | is_beacon(le16_to_cpu | 1401 | is_beacon(beacon->header.frame_ctl) ? |
1404 | (beacon->header. | ||
1405 | frame_ctl)) ? | ||
1406 | "BEACON" : "PROBE RESPONSE"); | 1402 | "BEACON" : "PROBE RESPONSE"); |
1407 | #endif | 1403 | #endif |
1408 | memcpy(target, &network, sizeof(*target)); | 1404 | memcpy(target, &network, sizeof(*target)); |
@@ -1412,16 +1408,14 @@ static void ieee80211_process_probe_response(struct ieee80211_device | |||
1412 | escape_essid(target->ssid, | 1408 | escape_essid(target->ssid, |
1413 | target->ssid_len), | 1409 | target->ssid_len), |
1414 | MAC_ARG(target->bssid), | 1410 | MAC_ARG(target->bssid), |
1415 | is_beacon(le16_to_cpu | 1411 | is_beacon(beacon->header.frame_ctl) ? |
1416 | (beacon->header. | ||
1417 | frame_ctl)) ? | ||
1418 | "BEACON" : "PROBE RESPONSE"); | 1412 | "BEACON" : "PROBE RESPONSE"); |
1419 | update_network(target, &network); | 1413 | update_network(target, &network); |
1420 | } | 1414 | } |
1421 | 1415 | ||
1422 | spin_unlock_irqrestore(&ieee->lock, flags); | 1416 | spin_unlock_irqrestore(&ieee->lock, flags); |
1423 | 1417 | ||
1424 | if (is_beacon(le16_to_cpu(beacon->header.frame_ctl))) { | 1418 | if (is_beacon(beacon->header.frame_ctl)) { |
1425 | if (ieee->handle_beacon != NULL) | 1419 | if (ieee->handle_beacon != NULL) |
1426 | ieee->handle_beacon(dev, beacon, &network); | 1420 | ieee->handle_beacon(dev, beacon, &network); |
1427 | } else { | 1421 | } else { |