summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/intersil/prism54
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/intersil/prism54')
-rw-r--r--drivers/net/wireless/intersil/prism54/isl_oid.h2
-rw-r--r--drivers/net/wireless/intersil/prism54/islpci_dev.c30
-rw-r--r--drivers/net/wireless/intersil/prism54/islpci_eth.c24
-rw-r--r--drivers/net/wireless/intersil/prism54/islpci_hotplug.c39
-rw-r--r--drivers/net/wireless/intersil/prism54/islpci_mgt.c21
5 files changed, 50 insertions, 66 deletions
diff --git a/drivers/net/wireless/intersil/prism54/isl_oid.h b/drivers/net/wireless/intersil/prism54/isl_oid.h
index 1afc2ccf94ca..b889bb73a485 100644
--- a/drivers/net/wireless/intersil/prism54/isl_oid.h
+++ b/drivers/net/wireless/intersil/prism54/isl_oid.h
@@ -143,7 +143,7 @@ enum dot11_priv_t {
* together with a CSMA contention. Without this all frames are
* sent with a CSMA contention.
* Bibliography:
- * http://www.hpl.hp.com/personal/Jean_Tourrilhes/Papers/Packet.Frame.Grouping.html
+ * https://www.hpl.hp.com/personal/Jean_Tourrilhes/Papers/Packet.Frame.Grouping.html
*/
enum dot11_maxframeburst_t {
/* Values for DOT11_OID_MAXFRAMEBURST */
diff --git a/drivers/net/wireless/intersil/prism54/islpci_dev.c b/drivers/net/wireless/intersil/prism54/islpci_dev.c
index a9bae69222dc..efd64e555bb5 100644
--- a/drivers/net/wireless/intersil/prism54/islpci_dev.c
+++ b/drivers/net/wireless/intersil/prism54/islpci_dev.c
@@ -636,10 +636,10 @@ islpci_alloc_memory(islpci_private *priv)
*/
/* perform the allocation */
- priv->driver_mem_address = pci_alloc_consistent(priv->pdev,
- HOST_MEM_BLOCK,
- &priv->
- device_host_address);
+ priv->driver_mem_address = dma_alloc_coherent(&priv->pdev->dev,
+ HOST_MEM_BLOCK,
+ &priv->device_host_address,
+ GFP_KERNEL);
if (!priv->driver_mem_address) {
/* error allocating the block of PCI memory */
@@ -692,11 +692,9 @@ islpci_alloc_memory(islpci_private *priv)
/* map the allocated skb data area to pci */
priv->pci_map_rx_address[counter] =
- pci_map_single(priv->pdev, (void *) skb->data,
- MAX_FRAGMENT_SIZE_RX + 2,
- PCI_DMA_FROMDEVICE);
- if (pci_dma_mapping_error(priv->pdev,
- priv->pci_map_rx_address[counter])) {
+ dma_map_single(&priv->pdev->dev, (void *)skb->data,
+ MAX_FRAGMENT_SIZE_RX + 2, DMA_FROM_DEVICE);
+ if (dma_mapping_error(&priv->pdev->dev, priv->pci_map_rx_address[counter])) {
priv->pci_map_rx_address[counter] = 0;
/* error mapping the buffer to device
accessible memory address */
@@ -727,9 +725,9 @@ islpci_free_memory(islpci_private *priv)
/* free consistent DMA area... */
if (priv->driver_mem_address)
- pci_free_consistent(priv->pdev, HOST_MEM_BLOCK,
- priv->driver_mem_address,
- priv->device_host_address);
+ dma_free_coherent(&priv->pdev->dev, HOST_MEM_BLOCK,
+ priv->driver_mem_address,
+ priv->device_host_address);
/* clear some dangling pointers */
priv->driver_mem_address = NULL;
@@ -741,8 +739,8 @@ islpci_free_memory(islpci_private *priv)
for (counter = 0; counter < ISL38XX_CB_MGMT_QSIZE; counter++) {
struct islpci_membuf *buf = &priv->mgmt_rx[counter];
if (buf->pci_addr)
- pci_unmap_single(priv->pdev, buf->pci_addr,
- buf->size, PCI_DMA_FROMDEVICE);
+ dma_unmap_single(&priv->pdev->dev, buf->pci_addr,
+ buf->size, DMA_FROM_DEVICE);
buf->pci_addr = 0;
kfree(buf->mem);
buf->size = 0;
@@ -752,10 +750,10 @@ islpci_free_memory(islpci_private *priv)
/* clean up data rx buffers */
for (counter = 0; counter < ISL38XX_CB_RX_QSIZE; counter++) {
if (priv->pci_map_rx_address[counter])
- pci_unmap_single(priv->pdev,
+ dma_unmap_single(&priv->pdev->dev,
priv->pci_map_rx_address[counter],
MAX_FRAGMENT_SIZE_RX + 2,
- PCI_DMA_FROMDEVICE);
+ DMA_FROM_DEVICE);
priv->pci_map_rx_address[counter] = 0;
if (priv->data_low_rx[counter])
diff --git a/drivers/net/wireless/intersil/prism54/islpci_eth.c b/drivers/net/wireless/intersil/prism54/islpci_eth.c
index 8d680250a281..74dd65716afd 100644
--- a/drivers/net/wireless/intersil/prism54/islpci_eth.c
+++ b/drivers/net/wireless/intersil/prism54/islpci_eth.c
@@ -50,9 +50,9 @@ islpci_eth_cleanup_transmit(islpci_private *priv,
skb, skb->data, skb->len, skb->truesize);
#endif
- pci_unmap_single(priv->pdev,
+ dma_unmap_single(&priv->pdev->dev,
priv->pci_map_tx_address[index],
- skb->len, PCI_DMA_TODEVICE);
+ skb->len, DMA_TO_DEVICE);
dev_kfree_skb_irq(skb);
skb = NULL;
}
@@ -176,10 +176,9 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
#endif
/* map the skb buffer to pci memory for DMA operation */
- pci_map_address = pci_map_single(priv->pdev,
- (void *) skb->data, skb->len,
- PCI_DMA_TODEVICE);
- if (pci_dma_mapping_error(priv->pdev, pci_map_address)) {
+ pci_map_address = dma_map_single(&priv->pdev->dev, (void *)skb->data,
+ skb->len, DMA_TO_DEVICE);
+ if (dma_mapping_error(&priv->pdev->dev, pci_map_address)) {
printk(KERN_WARNING "%s: cannot map buffer to PCI\n",
ndev->name);
goto drop_free;
@@ -323,9 +322,8 @@ islpci_eth_receive(islpci_private *priv)
#endif
/* delete the streaming DMA mapping before processing the skb */
- pci_unmap_single(priv->pdev,
- priv->pci_map_rx_address[index],
- MAX_FRAGMENT_SIZE_RX + 2, PCI_DMA_FROMDEVICE);
+ dma_unmap_single(&priv->pdev->dev, priv->pci_map_rx_address[index],
+ MAX_FRAGMENT_SIZE_RX + 2, DMA_FROM_DEVICE);
/* update the skb structure and align the buffer */
skb_put(skb, size);
@@ -431,11 +429,9 @@ islpci_eth_receive(islpci_private *priv)
/* set the streaming DMA mapping for proper PCI bus operation */
priv->pci_map_rx_address[index] =
- pci_map_single(priv->pdev, (void *) skb->data,
- MAX_FRAGMENT_SIZE_RX + 2,
- PCI_DMA_FROMDEVICE);
- if (pci_dma_mapping_error(priv->pdev,
- priv->pci_map_rx_address[index])) {
+ dma_map_single(&priv->pdev->dev, (void *)skb->data,
+ MAX_FRAGMENT_SIZE_RX + 2, DMA_FROM_DEVICE);
+ if (dma_mapping_error(&priv->pdev->dev, priv->pci_map_rx_address[index])) {
/* error mapping the buffer to device accessible memory address */
DEBUG(SHOW_ERROR_MESSAGES,
"Error mapping DMA address\n");
diff --git a/drivers/net/wireless/intersil/prism54/islpci_hotplug.c b/drivers/net/wireless/intersil/prism54/islpci_hotplug.c
index 20291c0d962d..31a1e61326ff 100644
--- a/drivers/net/wireless/intersil/prism54/islpci_hotplug.c
+++ b/drivers/net/wireless/intersil/prism54/islpci_hotplug.c
@@ -26,7 +26,8 @@ module_param(init_pcitm, int, 0);
/* In this order: vendor, device, subvendor, subdevice, class, class_mask,
* driver_data
* If you have an update for this please contact prism54-devel@prism54.org
- * The latest list can be found at http://wireless.kernel.org/en/users/Drivers/p54 */
+ * The latest list can be found at http://wireless.wiki.kernel.org/en/users/Drivers/p54
+ */
static const struct pci_device_id prism54_id_tbl[] = {
/* Intersil PRISM Duette/Prism GT Wireless LAN adapter */
{
@@ -63,16 +64,17 @@ MODULE_DEVICE_TABLE(pci, prism54_id_tbl);
static int prism54_probe(struct pci_dev *, const struct pci_device_id *);
static void prism54_remove(struct pci_dev *);
-static int prism54_suspend(struct pci_dev *, pm_message_t state);
-static int prism54_resume(struct pci_dev *);
+static int __maybe_unused prism54_suspend(struct device *);
+static int __maybe_unused prism54_resume(struct device *);
+
+static SIMPLE_DEV_PM_OPS(prism54_pm_ops, prism54_suspend, prism54_resume);
static struct pci_driver prism54_driver = {
.name = DRV_NAME,
.id_table = prism54_id_tbl,
.probe = prism54_probe,
.remove = prism54_remove,
- .suspend = prism54_suspend,
- .resume = prism54_resume,
+ .driver.pm = &prism54_pm_ops,
};
/******************************************************************************
@@ -106,7 +108,7 @@ prism54_probe(struct pci_dev *pdev, const struct pci_device_id *id)
}
/* enable PCI DMA */
- if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) {
+ if (dma_set_mask(&pdev->dev, DMA_BIT_MASK(32))) {
printk(KERN_ERR "%s: 32-bit PCI DMA not supported", DRV_NAME);
goto do_pci_disable_device;
}
@@ -243,16 +245,13 @@ prism54_remove(struct pci_dev *pdev)
pci_disable_device(pdev);
}
-static int
-prism54_suspend(struct pci_dev *pdev, pm_message_t state)
+static int __maybe_unused
+prism54_suspend(struct device *dev)
{
- struct net_device *ndev = pci_get_drvdata(pdev);
+ struct net_device *ndev = dev_get_drvdata(dev);
islpci_private *priv = ndev ? netdev_priv(ndev) : NULL;
BUG_ON(!priv);
-
- pci_save_state(pdev);
-
/* tell the device not to trigger interrupts for now... */
isl38xx_disable_interrupts(priv->device_base);
@@ -266,26 +265,16 @@ prism54_suspend(struct pci_dev *pdev, pm_message_t state)
return 0;
}
-static int
-prism54_resume(struct pci_dev *pdev)
+static int __maybe_unused
+prism54_resume(struct device *dev)
{
- struct net_device *ndev = pci_get_drvdata(pdev);
+ struct net_device *ndev = dev_get_drvdata(dev);
islpci_private *priv = ndev ? netdev_priv(ndev) : NULL;
- int err;
BUG_ON(!priv);
printk(KERN_NOTICE "%s: got resume request\n", ndev->name);
- err = pci_enable_device(pdev);
- if (err) {
- printk(KERN_ERR "%s: pci_enable_device failed on resume\n",
- ndev->name);
- return err;
- }
-
- pci_restore_state(pdev);
-
/* alright let's go into the PREBOOT state */
islpci_reset(priv, 1);
diff --git a/drivers/net/wireless/intersil/prism54/islpci_mgt.c b/drivers/net/wireless/intersil/prism54/islpci_mgt.c
index e336eb106429..0c7fb76c7d1c 100644
--- a/drivers/net/wireless/intersil/prism54/islpci_mgt.c
+++ b/drivers/net/wireless/intersil/prism54/islpci_mgt.c
@@ -115,10 +115,11 @@ islpci_mgmt_rx_fill(struct net_device *ndev)
buf->size = MGMT_FRAME_SIZE;
}
if (buf->pci_addr == 0) {
- buf->pci_addr = pci_map_single(priv->pdev, buf->mem,
+ buf->pci_addr = dma_map_single(&priv->pdev->dev,
+ buf->mem,
MGMT_FRAME_SIZE,
- PCI_DMA_FROMDEVICE);
- if (pci_dma_mapping_error(priv->pdev, buf->pci_addr)) {
+ DMA_FROM_DEVICE);
+ if (dma_mapping_error(&priv->pdev->dev, buf->pci_addr)) {
printk(KERN_WARNING
"Failed to make memory DMA'able.\n");
return -ENOMEM;
@@ -203,9 +204,9 @@ islpci_mgt_transmit(struct net_device *ndev, int operation, unsigned long oid,
#endif
err = -ENOMEM;
- buf.pci_addr = pci_map_single(priv->pdev, buf.mem, frag_len,
- PCI_DMA_TODEVICE);
- if (pci_dma_mapping_error(priv->pdev, buf.pci_addr)) {
+ buf.pci_addr = dma_map_single(&priv->pdev->dev, buf.mem, frag_len,
+ DMA_TO_DEVICE);
+ if (dma_mapping_error(&priv->pdev->dev, buf.pci_addr)) {
printk(KERN_WARNING "%s: cannot map PCI memory for mgmt\n",
ndev->name);
goto error_free;
@@ -302,8 +303,8 @@ islpci_mgt_receive(struct net_device *ndev)
}
/* Ensure the results of device DMA are visible to the CPU. */
- pci_dma_sync_single_for_cpu(priv->pdev, buf->pci_addr,
- buf->size, PCI_DMA_FROMDEVICE);
+ dma_sync_single_for_cpu(&priv->pdev->dev, buf->pci_addr,
+ buf->size, DMA_FROM_DEVICE);
/* Perform endianess conversion for PIMFOR header in-place. */
header = pimfor_decode_header(buf->mem, frag_len);
@@ -414,8 +415,8 @@ islpci_mgt_cleanup_transmit(struct net_device *ndev)
for (; priv->index_mgmt_tx < curr_frag; priv->index_mgmt_tx++) {
int index = priv->index_mgmt_tx % ISL38XX_CB_MGMT_QSIZE;
struct islpci_membuf *buf = &priv->mgmt_tx[index];
- pci_unmap_single(priv->pdev, buf->pci_addr, buf->size,
- PCI_DMA_TODEVICE);
+ dma_unmap_single(&priv->pdev->dev, buf->pci_addr, buf->size,
+ DMA_TO_DEVICE);
buf->pci_addr = 0;
kfree(buf->mem);
buf->mem = NULL;