diff options
Diffstat (limited to 'drivers/atm')
-rw-r--r-- | drivers/atm/he.c | 11 | ||||
-rw-r--r-- | drivers/atm/he.h | 13 | ||||
-rw-r--r-- | drivers/atm/iphase.c | 27 |
3 files changed, 26 insertions, 25 deletions
diff --git a/drivers/atm/he.c b/drivers/atm/he.c index ffc4a5a4194..ea495b21f91 100644 --- a/drivers/atm/he.c +++ b/drivers/atm/he.c | |||
@@ -1542,7 +1542,8 @@ he_start(struct atm_dev *dev) | |||
1542 | /* initialize framer */ | 1542 | /* initialize framer */ |
1543 | 1543 | ||
1544 | #ifdef CONFIG_ATM_HE_USE_SUNI | 1544 | #ifdef CONFIG_ATM_HE_USE_SUNI |
1545 | suni_init(he_dev->atm_dev); | 1545 | if (he_isMM(he_dev)) |
1546 | suni_init(he_dev->atm_dev); | ||
1546 | if (he_dev->atm_dev->phy && he_dev->atm_dev->phy->start) | 1547 | if (he_dev->atm_dev->phy && he_dev->atm_dev->phy->start) |
1547 | he_dev->atm_dev->phy->start(he_dev->atm_dev); | 1548 | he_dev->atm_dev->phy->start(he_dev->atm_dev); |
1548 | #endif /* CONFIG_ATM_HE_USE_SUNI */ | 1549 | #endif /* CONFIG_ATM_HE_USE_SUNI */ |
@@ -1554,6 +1555,7 @@ he_start(struct atm_dev *dev) | |||
1554 | val = he_phy_get(he_dev->atm_dev, SUNI_TPOP_APM); | 1555 | val = he_phy_get(he_dev->atm_dev, SUNI_TPOP_APM); |
1555 | val = (val & ~SUNI_TPOP_APM_S) | (SUNI_TPOP_S_SDH << SUNI_TPOP_APM_S_SHIFT); | 1556 | val = (val & ~SUNI_TPOP_APM_S) | (SUNI_TPOP_S_SDH << SUNI_TPOP_APM_S_SHIFT); |
1556 | he_phy_put(he_dev->atm_dev, val, SUNI_TPOP_APM); | 1557 | he_phy_put(he_dev->atm_dev, val, SUNI_TPOP_APM); |
1558 | he_phy_put(he_dev->atm_dev, SUNI_TACP_IUCHP_CLP, SUNI_TACP_IUCHP); | ||
1557 | } | 1559 | } |
1558 | 1560 | ||
1559 | /* 5.1.12 enable transmit and receive */ | 1561 | /* 5.1.12 enable transmit and receive */ |
@@ -2844,10 +2846,15 @@ he_ioctl(struct atm_dev *atm_dev, unsigned int cmd, void __user *arg) | |||
2844 | if (copy_from_user(®, arg, | 2846 | if (copy_from_user(®, arg, |
2845 | sizeof(struct he_ioctl_reg))) | 2847 | sizeof(struct he_ioctl_reg))) |
2846 | return -EFAULT; | 2848 | return -EFAULT; |
2847 | 2849 | ||
2848 | spin_lock_irqsave(&he_dev->global_lock, flags); | 2850 | spin_lock_irqsave(&he_dev->global_lock, flags); |
2849 | switch (reg.type) { | 2851 | switch (reg.type) { |
2850 | case HE_REGTYPE_PCI: | 2852 | case HE_REGTYPE_PCI: |
2853 | if (reg.addr < 0 || reg.addr >= HE_REGMAP_SIZE) { | ||
2854 | err = -EINVAL; | ||
2855 | break; | ||
2856 | } | ||
2857 | |||
2851 | reg.val = he_readl(he_dev, reg.addr); | 2858 | reg.val = he_readl(he_dev, reg.addr); |
2852 | break; | 2859 | break; |
2853 | case HE_REGTYPE_RCM: | 2860 | case HE_REGTYPE_RCM: |
diff --git a/drivers/atm/he.h b/drivers/atm/he.h index fe6cd15a78a..b87d6ccabac 100644 --- a/drivers/atm/he.h +++ b/drivers/atm/he.h | |||
@@ -267,13 +267,7 @@ struct he_dev { | |||
267 | 267 | ||
268 | char prod_id[30]; | 268 | char prod_id[30]; |
269 | char mac_addr[6]; | 269 | char mac_addr[6]; |
270 | int media; /* | 270 | int media; |
271 | * 0x26 = HE155 MM | ||
272 | * 0x27 = HE622 MM | ||
273 | * 0x46 = HE155 SM | ||
274 | * 0x47 = HE622 SM | ||
275 | */ | ||
276 | |||
277 | 271 | ||
278 | unsigned int vcibits, vpibits; | 272 | unsigned int vcibits, vpibits; |
279 | unsigned int cells_per_row; | 273 | unsigned int cells_per_row; |
@@ -392,6 +386,7 @@ struct he_vcc | |||
392 | #define HE_DEV(dev) ((struct he_dev *) (dev)->dev_data) | 386 | #define HE_DEV(dev) ((struct he_dev *) (dev)->dev_data) |
393 | 387 | ||
394 | #define he_is622(dev) ((dev)->media & 0x1) | 388 | #define he_is622(dev) ((dev)->media & 0x1) |
389 | #define he_isMM(dev) ((dev)->media & 0x20) | ||
395 | 390 | ||
396 | #define HE_REGMAP_SIZE 0x100000 | 391 | #define HE_REGMAP_SIZE 0x100000 |
397 | 392 | ||
@@ -876,8 +871,8 @@ struct he_vcc | |||
876 | #define M_SN 0x3a /* integer */ | 871 | #define M_SN 0x3a /* integer */ |
877 | #define MEDIA 0x3e /* integer */ | 872 | #define MEDIA 0x3e /* integer */ |
878 | #define HE155MM 0x26 | 873 | #define HE155MM 0x26 |
879 | #define HE155SM 0x27 | 874 | #define HE622MM 0x27 |
880 | #define HE622MM 0x46 | 875 | #define HE155SM 0x46 |
881 | #define HE622SM 0x47 | 876 | #define HE622SM 0x47 |
882 | #define MAC_ADDR 0x42 /* char[] */ | 877 | #define MAC_ADDR 0x42 /* char[] */ |
883 | 878 | ||
diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c index 5c28ca7380f..139fce6968a 100644 --- a/drivers/atm/iphase.c +++ b/drivers/atm/iphase.c | |||
@@ -2562,17 +2562,11 @@ static int __devinit ia_start(struct atm_dev *dev) | |||
2562 | error = suni_init(dev); | 2562 | error = suni_init(dev); |
2563 | if (error) | 2563 | if (error) |
2564 | goto err_free_rx; | 2564 | goto err_free_rx; |
2565 | /* | 2565 | if (dev->phy->start) { |
2566 | * Enable interrupt on loss of signal | 2566 | error = dev->phy->start(dev); |
2567 | * SUNI_RSOP_CIE - 0x10 | 2567 | if (error) |
2568 | * SUNI_RSOP_CIE_LOSE - 0x04 | 2568 | goto err_free_rx; |
2569 | */ | 2569 | } |
2570 | ia_phy_put(dev, ia_phy_get(dev, 0x10) | 0x04, 0x10); | ||
2571 | #ifndef MODULE | ||
2572 | error = dev->phy->start(dev); | ||
2573 | if (error) | ||
2574 | goto err_free_rx; | ||
2575 | #endif | ||
2576 | /* Get iadev->carrier_detect status */ | 2570 | /* Get iadev->carrier_detect status */ |
2577 | IaFrontEndIntr(iadev); | 2571 | IaFrontEndIntr(iadev); |
2578 | } | 2572 | } |
@@ -3198,6 +3192,8 @@ static int __devinit ia_init_one(struct pci_dev *pdev, | |||
3198 | IF_INIT(printk("dev_id = 0x%x iadev->LineRate = %d \n", (u32)dev, | 3192 | IF_INIT(printk("dev_id = 0x%x iadev->LineRate = %d \n", (u32)dev, |
3199 | iadev->LineRate);) | 3193 | iadev->LineRate);) |
3200 | 3194 | ||
3195 | pci_set_drvdata(pdev, dev); | ||
3196 | |||
3201 | ia_dev[iadev_count] = iadev; | 3197 | ia_dev[iadev_count] = iadev; |
3202 | _ia_dev[iadev_count] = dev; | 3198 | _ia_dev[iadev_count] = dev; |
3203 | iadev_count++; | 3199 | iadev_count++; |
@@ -3219,8 +3215,6 @@ static int __devinit ia_init_one(struct pci_dev *pdev, | |||
3219 | iadev->next_board = ia_boards; | 3215 | iadev->next_board = ia_boards; |
3220 | ia_boards = dev; | 3216 | ia_boards = dev; |
3221 | 3217 | ||
3222 | pci_set_drvdata(pdev, dev); | ||
3223 | |||
3224 | return 0; | 3218 | return 0; |
3225 | 3219 | ||
3226 | err_out_deregister_dev: | 3220 | err_out_deregister_dev: |
@@ -3238,9 +3232,14 @@ static void __devexit ia_remove_one(struct pci_dev *pdev) | |||
3238 | struct atm_dev *dev = pci_get_drvdata(pdev); | 3232 | struct atm_dev *dev = pci_get_drvdata(pdev); |
3239 | IADEV *iadev = INPH_IA_DEV(dev); | 3233 | IADEV *iadev = INPH_IA_DEV(dev); |
3240 | 3234 | ||
3241 | ia_phy_put(dev, ia_phy_get(dev,0x10) & ~(0x4), 0x10); | 3235 | /* Disable phy interrupts */ |
3236 | ia_phy_put(dev, ia_phy_get(dev, SUNI_RSOP_CIE) & ~(SUNI_RSOP_CIE_LOSE), | ||
3237 | SUNI_RSOP_CIE); | ||
3242 | udelay(1); | 3238 | udelay(1); |
3243 | 3239 | ||
3240 | if (dev->phy && dev->phy->stop) | ||
3241 | dev->phy->stop(dev); | ||
3242 | |||
3244 | /* De-register device */ | 3243 | /* De-register device */ |
3245 | free_irq(iadev->irq, dev); | 3244 | free_irq(iadev->irq, dev); |
3246 | iadev_count--; | 3245 | iadev_count--; |