diff options
Diffstat (limited to 'drivers/net/sky2.c')
-rw-r--r-- | drivers/net/sky2.c | 77 |
1 files changed, 0 insertions, 77 deletions
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); |