diff options
Diffstat (limited to 'drivers/atm/iphase.c')
-rw-r--r-- | drivers/atm/iphase.c | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c index 139fce6968a6..24df73ad326d 100644 --- a/drivers/atm/iphase.c +++ b/drivers/atm/iphase.c | |||
@@ -65,12 +65,7 @@ | |||
65 | #include "iphase.h" | 65 | #include "iphase.h" |
66 | #include "suni.h" | 66 | #include "suni.h" |
67 | #define swap(x) (((x & 0xff) << 8) | ((x & 0xff00) >> 8)) | 67 | #define swap(x) (((x & 0xff) << 8) | ((x & 0xff00) >> 8)) |
68 | struct suni_priv { | 68 | |
69 | struct k_sonet_stats sonet_stats; /* link diagnostics */ | ||
70 | unsigned char loop_mode; /* loopback mode */ | ||
71 | struct atm_dev *dev; /* device back-pointer */ | ||
72 | struct suni_priv *next; /* next SUNI */ | ||
73 | }; | ||
74 | #define PRIV(dev) ((struct suni_priv *) dev->phy_data) | 69 | #define PRIV(dev) ((struct suni_priv *) dev->phy_data) |
75 | 70 | ||
76 | static unsigned char ia_phy_get(struct atm_dev *dev, unsigned long addr); | 71 | static unsigned char ia_phy_get(struct atm_dev *dev, unsigned long addr); |
@@ -94,10 +89,6 @@ module_param(IADebugFlag, uint, 0644); | |||
94 | 89 | ||
95 | MODULE_LICENSE("GPL"); | 90 | MODULE_LICENSE("GPL"); |
96 | 91 | ||
97 | #if BITS_PER_LONG != 32 | ||
98 | # error FIXME: this driver only works on 32-bit platforms | ||
99 | #endif | ||
100 | |||
101 | /**************************** IA_LIB **********************************/ | 92 | /**************************** IA_LIB **********************************/ |
102 | 93 | ||
103 | static void ia_init_rtn_q (IARTN_Q *que) | 94 | static void ia_init_rtn_q (IARTN_Q *que) |
@@ -1411,7 +1402,6 @@ static int rx_init(struct atm_dev *dev) | |||
1411 | struct abr_vc_table *abr_vc_table; | 1402 | struct abr_vc_table *abr_vc_table; |
1412 | u16 *vc_table; | 1403 | u16 *vc_table; |
1413 | u16 *reass_table; | 1404 | u16 *reass_table; |
1414 | u16 *ptr16; | ||
1415 | int i,j, vcsize_sel; | 1405 | int i,j, vcsize_sel; |
1416 | u_short freeq_st_adr; | 1406 | u_short freeq_st_adr; |
1417 | u_short *freeq_start; | 1407 | u_short *freeq_start; |
@@ -1426,14 +1416,15 @@ static int rx_init(struct atm_dev *dev) | |||
1426 | printk(KERN_ERR DEV_LABEL "can't allocate DLEs\n"); | 1416 | printk(KERN_ERR DEV_LABEL "can't allocate DLEs\n"); |
1427 | goto err_out; | 1417 | goto err_out; |
1428 | } | 1418 | } |
1429 | iadev->rx_dle_q.start = (struct dle*)dle_addr; | 1419 | iadev->rx_dle_q.start = (struct dle *)dle_addr; |
1430 | iadev->rx_dle_q.read = iadev->rx_dle_q.start; | 1420 | iadev->rx_dle_q.read = iadev->rx_dle_q.start; |
1431 | iadev->rx_dle_q.write = iadev->rx_dle_q.start; | 1421 | iadev->rx_dle_q.write = iadev->rx_dle_q.start; |
1432 | iadev->rx_dle_q.end = (struct dle*)((u32)dle_addr+sizeof(struct dle)*DLE_ENTRIES); | 1422 | iadev->rx_dle_q.end = (struct dle*)((unsigned long)dle_addr+sizeof(struct dle)*DLE_ENTRIES); |
1433 | /* the end of the dle q points to the entry after the last | 1423 | /* the end of the dle q points to the entry after the last |
1434 | DLE that can be used. */ | 1424 | DLE that can be used. */ |
1435 | 1425 | ||
1436 | /* write the upper 20 bits of the start address to rx list address register */ | 1426 | /* write the upper 20 bits of the start address to rx list address register */ |
1427 | /* We know this is 32bit bus addressed so the following is safe */ | ||
1437 | writel(iadev->rx_dle_dma & 0xfffff000, | 1428 | writel(iadev->rx_dle_dma & 0xfffff000, |
1438 | iadev->dma + IPHASE5575_RX_LIST_ADDR); | 1429 | iadev->dma + IPHASE5575_RX_LIST_ADDR); |
1439 | IF_INIT(printk("Tx Dle list addr: 0x%08x value: 0x%0x\n", | 1430 | IF_INIT(printk("Tx Dle list addr: 0x%08x value: 0x%0x\n", |
@@ -1587,11 +1578,12 @@ static int rx_init(struct atm_dev *dev) | |||
1587 | Set Packet Aging Interval count register to overflow in about 4 us | 1578 | Set Packet Aging Interval count register to overflow in about 4 us |
1588 | */ | 1579 | */ |
1589 | writew(0xF6F8, iadev->reass_reg+PKT_TM_CNT ); | 1580 | writew(0xF6F8, iadev->reass_reg+PKT_TM_CNT ); |
1590 | ptr16 = (u16*)j; | 1581 | |
1591 | i = ((u32)ptr16 >> 6) & 0xff; | 1582 | i = (j >> 6) & 0xFF; |
1592 | ptr16 += j - 1; | 1583 | j += 2 * (j - 1); |
1593 | i |=(((u32)ptr16 << 2) & 0xff00); | 1584 | i |= ((j << 2) & 0xFF00); |
1594 | writew(i, iadev->reass_reg+TMOUT_RANGE); | 1585 | writew(i, iadev->reass_reg+TMOUT_RANGE); |
1586 | |||
1595 | /* initiate the desc_tble */ | 1587 | /* initiate the desc_tble */ |
1596 | for(i=0; i<iadev->num_tx_desc;i++) | 1588 | for(i=0; i<iadev->num_tx_desc;i++) |
1597 | iadev->desc_tbl[i].timestamp = 0; | 1589 | iadev->desc_tbl[i].timestamp = 0; |
@@ -1914,7 +1906,7 @@ static int tx_init(struct atm_dev *dev) | |||
1914 | iadev->tx_dle_q.start = (struct dle*)dle_addr; | 1906 | iadev->tx_dle_q.start = (struct dle*)dle_addr; |
1915 | iadev->tx_dle_q.read = iadev->tx_dle_q.start; | 1907 | iadev->tx_dle_q.read = iadev->tx_dle_q.start; |
1916 | iadev->tx_dle_q.write = iadev->tx_dle_q.start; | 1908 | iadev->tx_dle_q.write = iadev->tx_dle_q.start; |
1917 | iadev->tx_dle_q.end = (struct dle*)((u32)dle_addr+sizeof(struct dle)*DLE_ENTRIES); | 1909 | iadev->tx_dle_q.end = (struct dle*)((unsigned long)dle_addr+sizeof(struct dle)*DLE_ENTRIES); |
1918 | 1910 | ||
1919 | /* write the upper 20 bits of the start address to tx list address register */ | 1911 | /* write the upper 20 bits of the start address to tx list address register */ |
1920 | writel(iadev->tx_dle_dma & 0xfffff000, | 1912 | writel(iadev->tx_dle_dma & 0xfffff000, |
@@ -2907,7 +2899,7 @@ static int ia_pkt_tx (struct atm_vcc *vcc, struct sk_buff *skb) { | |||
2907 | dev_kfree_skb_any(skb); | 2899 | dev_kfree_skb_any(skb); |
2908 | return 0; | 2900 | return 0; |
2909 | } | 2901 | } |
2910 | if ((u32)skb->data & 3) { | 2902 | if ((unsigned long)skb->data & 3) { |
2911 | printk("Misaligned SKB\n"); | 2903 | printk("Misaligned SKB\n"); |
2912 | if (vcc->pop) | 2904 | if (vcc->pop) |
2913 | vcc->pop(vcc, skb); | 2905 | vcc->pop(vcc, skb); |