diff options
author | chas williams - CONTRACTOR <chas@cmf.nrl.navy.mil> | 2015-01-16 08:57:21 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-01-18 00:28:41 -0500 |
commit | ede58ef28e105de94475b2b69fa069c9a2ce6933 (patch) | |
tree | f7a4a505d2aa25808605b6ff74c2aa7e058ffd39 /drivers/atm/iphase.c | |
parent | abee1cef7343197dd54e40df790ebbc8bd845d29 (diff) |
atm: remove deprecated use of pci api
Signed-off-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/atm/iphase.c')
-rw-r--r-- | drivers/atm/iphase.c | 54 |
1 files changed, 28 insertions, 26 deletions
diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c index 4217f29a85e0..924f8e26789d 100644 --- a/drivers/atm/iphase.c +++ b/drivers/atm/iphase.c | |||
@@ -1185,8 +1185,8 @@ static int rx_pkt(struct atm_dev *dev) | |||
1185 | 1185 | ||
1186 | /* Build the DLE structure */ | 1186 | /* Build the DLE structure */ |
1187 | wr_ptr = iadev->rx_dle_q.write; | 1187 | wr_ptr = iadev->rx_dle_q.write; |
1188 | wr_ptr->sys_pkt_addr = pci_map_single(iadev->pci, skb->data, | 1188 | wr_ptr->sys_pkt_addr = dma_map_single(&iadev->pci->dev, skb->data, |
1189 | len, PCI_DMA_FROMDEVICE); | 1189 | len, DMA_FROM_DEVICE); |
1190 | wr_ptr->local_pkt_addr = buf_addr; | 1190 | wr_ptr->local_pkt_addr = buf_addr; |
1191 | wr_ptr->bytes = len; /* We don't know this do we ?? */ | 1191 | wr_ptr->bytes = len; /* We don't know this do we ?? */ |
1192 | wr_ptr->mode = DMA_INT_ENABLE; | 1192 | wr_ptr->mode = DMA_INT_ENABLE; |
@@ -1306,8 +1306,8 @@ static void rx_dle_intr(struct atm_dev *dev) | |||
1306 | u_short length; | 1306 | u_short length; |
1307 | struct ia_vcc *ia_vcc; | 1307 | struct ia_vcc *ia_vcc; |
1308 | 1308 | ||
1309 | pci_unmap_single(iadev->pci, iadev->rx_dle_q.write->sys_pkt_addr, | 1309 | dma_unmap_single(&iadev->pci->dev, iadev->rx_dle_q.write->sys_pkt_addr, |
1310 | len, PCI_DMA_FROMDEVICE); | 1310 | len, DMA_FROM_DEVICE); |
1311 | /* no VCC related housekeeping done as yet. lets see */ | 1311 | /* no VCC related housekeeping done as yet. lets see */ |
1312 | vcc = ATM_SKB(skb)->vcc; | 1312 | vcc = ATM_SKB(skb)->vcc; |
1313 | if (!vcc) { | 1313 | if (!vcc) { |
@@ -1430,8 +1430,8 @@ static int rx_init(struct atm_dev *dev) | |||
1430 | // spin_lock_init(&iadev->rx_lock); | 1430 | // spin_lock_init(&iadev->rx_lock); |
1431 | 1431 | ||
1432 | /* Allocate 4k bytes - more aligned than needed (4k boundary) */ | 1432 | /* Allocate 4k bytes - more aligned than needed (4k boundary) */ |
1433 | dle_addr = pci_alloc_consistent(iadev->pci, DLE_TOTAL_SIZE, | 1433 | dle_addr = dma_alloc_coherent(&iadev->pci->dev, DLE_TOTAL_SIZE, |
1434 | &iadev->rx_dle_dma); | 1434 | &iadev->rx_dle_dma, GFP_KERNEL); |
1435 | if (!dle_addr) { | 1435 | if (!dle_addr) { |
1436 | printk(KERN_ERR DEV_LABEL "can't allocate DLEs\n"); | 1436 | printk(KERN_ERR DEV_LABEL "can't allocate DLEs\n"); |
1437 | goto err_out; | 1437 | goto err_out; |
@@ -1631,8 +1631,8 @@ static int rx_init(struct atm_dev *dev) | |||
1631 | return 0; | 1631 | return 0; |
1632 | 1632 | ||
1633 | err_free_dle: | 1633 | err_free_dle: |
1634 | pci_free_consistent(iadev->pci, DLE_TOTAL_SIZE, iadev->rx_dle_q.start, | 1634 | dma_free_coherent(&iadev->pci->dev, DLE_TOTAL_SIZE, iadev->rx_dle_q.start, |
1635 | iadev->rx_dle_dma); | 1635 | iadev->rx_dle_dma); |
1636 | err_out: | 1636 | err_out: |
1637 | return -ENOMEM; | 1637 | return -ENOMEM; |
1638 | } | 1638 | } |
@@ -1702,8 +1702,8 @@ static void tx_dle_intr(struct atm_dev *dev) | |||
1702 | 1702 | ||
1703 | /* Revenge of the 2 dle (skb + trailer) used in ia_pkt_tx() */ | 1703 | /* Revenge of the 2 dle (skb + trailer) used in ia_pkt_tx() */ |
1704 | if (!((dle - iadev->tx_dle_q.start)%(2*sizeof(struct dle)))) { | 1704 | if (!((dle - iadev->tx_dle_q.start)%(2*sizeof(struct dle)))) { |
1705 | pci_unmap_single(iadev->pci, dle->sys_pkt_addr, skb->len, | 1705 | dma_unmap_single(&iadev->pci->dev, dle->sys_pkt_addr, skb->len, |
1706 | PCI_DMA_TODEVICE); | 1706 | DMA_TO_DEVICE); |
1707 | } | 1707 | } |
1708 | vcc = ATM_SKB(skb)->vcc; | 1708 | vcc = ATM_SKB(skb)->vcc; |
1709 | if (!vcc) { | 1709 | if (!vcc) { |
@@ -1917,8 +1917,8 @@ static int tx_init(struct atm_dev *dev) | |||
1917 | readw(iadev->seg_reg+SEG_MASK_REG));) | 1917 | readw(iadev->seg_reg+SEG_MASK_REG));) |
1918 | 1918 | ||
1919 | /* Allocate 4k (boundary aligned) bytes */ | 1919 | /* Allocate 4k (boundary aligned) bytes */ |
1920 | dle_addr = pci_alloc_consistent(iadev->pci, DLE_TOTAL_SIZE, | 1920 | dle_addr = dma_alloc_coherent(&iadev->pci->dev, DLE_TOTAL_SIZE, |
1921 | &iadev->tx_dle_dma); | 1921 | &iadev->tx_dle_dma, GFP_KERNEL); |
1922 | if (!dle_addr) { | 1922 | if (!dle_addr) { |
1923 | printk(KERN_ERR DEV_LABEL "can't allocate DLEs\n"); | 1923 | printk(KERN_ERR DEV_LABEL "can't allocate DLEs\n"); |
1924 | goto err_out; | 1924 | goto err_out; |
@@ -1989,8 +1989,10 @@ static int tx_init(struct atm_dev *dev) | |||
1989 | goto err_free_tx_bufs; | 1989 | goto err_free_tx_bufs; |
1990 | } | 1990 | } |
1991 | iadev->tx_buf[i].cpcs = cpcs; | 1991 | iadev->tx_buf[i].cpcs = cpcs; |
1992 | iadev->tx_buf[i].dma_addr = pci_map_single(iadev->pci, | 1992 | iadev->tx_buf[i].dma_addr = dma_map_single(&iadev->pci->dev, |
1993 | cpcs, sizeof(*cpcs), PCI_DMA_TODEVICE); | 1993 | cpcs, |
1994 | sizeof(*cpcs), | ||
1995 | DMA_TO_DEVICE); | ||
1994 | } | 1996 | } |
1995 | iadev->desc_tbl = kmalloc(iadev->num_tx_desc * | 1997 | iadev->desc_tbl = kmalloc(iadev->num_tx_desc * |
1996 | sizeof(struct desc_tbl_t), GFP_KERNEL); | 1998 | sizeof(struct desc_tbl_t), GFP_KERNEL); |
@@ -2198,14 +2200,14 @@ err_free_tx_bufs: | |||
2198 | while (--i >= 0) { | 2200 | while (--i >= 0) { |
2199 | struct cpcs_trailer_desc *desc = iadev->tx_buf + i; | 2201 | struct cpcs_trailer_desc *desc = iadev->tx_buf + i; |
2200 | 2202 | ||
2201 | pci_unmap_single(iadev->pci, desc->dma_addr, | 2203 | dma_unmap_single(&iadev->pci->dev, desc->dma_addr, |
2202 | sizeof(*desc->cpcs), PCI_DMA_TODEVICE); | 2204 | sizeof(*desc->cpcs), DMA_TO_DEVICE); |
2203 | kfree(desc->cpcs); | 2205 | kfree(desc->cpcs); |
2204 | } | 2206 | } |
2205 | kfree(iadev->tx_buf); | 2207 | kfree(iadev->tx_buf); |
2206 | err_free_dle: | 2208 | err_free_dle: |
2207 | pci_free_consistent(iadev->pci, DLE_TOTAL_SIZE, iadev->tx_dle_q.start, | 2209 | dma_free_coherent(&iadev->pci->dev, DLE_TOTAL_SIZE, iadev->tx_dle_q.start, |
2208 | iadev->tx_dle_dma); | 2210 | iadev->tx_dle_dma); |
2209 | err_out: | 2211 | err_out: |
2210 | return -ENOMEM; | 2212 | return -ENOMEM; |
2211 | } | 2213 | } |
@@ -2476,20 +2478,20 @@ static void ia_free_tx(IADEV *iadev) | |||
2476 | for (i = 0; i < iadev->num_tx_desc; i++) { | 2478 | for (i = 0; i < iadev->num_tx_desc; i++) { |
2477 | struct cpcs_trailer_desc *desc = iadev->tx_buf + i; | 2479 | struct cpcs_trailer_desc *desc = iadev->tx_buf + i; |
2478 | 2480 | ||
2479 | pci_unmap_single(iadev->pci, desc->dma_addr, | 2481 | dma_unmap_single(&iadev->pci->dev, desc->dma_addr, |
2480 | sizeof(*desc->cpcs), PCI_DMA_TODEVICE); | 2482 | sizeof(*desc->cpcs), DMA_TO_DEVICE); |
2481 | kfree(desc->cpcs); | 2483 | kfree(desc->cpcs); |
2482 | } | 2484 | } |
2483 | kfree(iadev->tx_buf); | 2485 | kfree(iadev->tx_buf); |
2484 | pci_free_consistent(iadev->pci, DLE_TOTAL_SIZE, iadev->tx_dle_q.start, | 2486 | dma_free_coherent(&iadev->pci->dev, DLE_TOTAL_SIZE, iadev->tx_dle_q.start, |
2485 | iadev->tx_dle_dma); | 2487 | iadev->tx_dle_dma); |
2486 | } | 2488 | } |
2487 | 2489 | ||
2488 | static void ia_free_rx(IADEV *iadev) | 2490 | static void ia_free_rx(IADEV *iadev) |
2489 | { | 2491 | { |
2490 | kfree(iadev->rx_open); | 2492 | kfree(iadev->rx_open); |
2491 | pci_free_consistent(iadev->pci, DLE_TOTAL_SIZE, iadev->rx_dle_q.start, | 2493 | dma_free_coherent(&iadev->pci->dev, DLE_TOTAL_SIZE, iadev->rx_dle_q.start, |
2492 | iadev->rx_dle_dma); | 2494 | iadev->rx_dle_dma); |
2493 | } | 2495 | } |
2494 | 2496 | ||
2495 | static int ia_start(struct atm_dev *dev) | 2497 | static int ia_start(struct atm_dev *dev) |
@@ -3009,8 +3011,8 @@ static int ia_pkt_tx (struct atm_vcc *vcc, struct sk_buff *skb) { | |||
3009 | /* Build the DLE structure */ | 3011 | /* Build the DLE structure */ |
3010 | wr_ptr = iadev->tx_dle_q.write; | 3012 | wr_ptr = iadev->tx_dle_q.write; |
3011 | memset((caddr_t)wr_ptr, 0, sizeof(*wr_ptr)); | 3013 | memset((caddr_t)wr_ptr, 0, sizeof(*wr_ptr)); |
3012 | wr_ptr->sys_pkt_addr = pci_map_single(iadev->pci, skb->data, | 3014 | wr_ptr->sys_pkt_addr = dma_map_single(&iadev->pci->dev, skb->data, |
3013 | skb->len, PCI_DMA_TODEVICE); | 3015 | skb->len, DMA_TO_DEVICE); |
3014 | wr_ptr->local_pkt_addr = (buf_desc_ptr->buf_start_hi << 16) | | 3016 | wr_ptr->local_pkt_addr = (buf_desc_ptr->buf_start_hi << 16) | |
3015 | buf_desc_ptr->buf_start_lo; | 3017 | buf_desc_ptr->buf_start_lo; |
3016 | /* wr_ptr->bytes = swap_byte_order(total_len); didn't seem to affect?? */ | 3018 | /* wr_ptr->bytes = swap_byte_order(total_len); didn't seem to affect?? */ |