Commit 69a43ac0 authored by Ralf Baechle's avatar Ralf Baechle Committed by Jeff Garzik

SAA9730: Fix large pile of warnings

The SAA9730 driver doesn't quite grok what the difference between an ioport
and memory mapped I/O is.  It just happened to work on the one Linux
system the SAA9730 happens to spend it's misserable existence on.

drivers/net/saa9730.c: In function 'evm_saa9730_enable_lan_int':
drivers/net/saa9730.c:68: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c:70: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c:72: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c: In function 'evm_saa9730_disable_lan_int':
drivers/net/saa9730.c:78: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c:80: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c: In function 'evm_saa9730_clear_lan_int':
drivers/net/saa9730.c:85: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c: In function 'evm_saa9730_block_lan_int':
drivers/net/saa9730.c:91: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c: In function 'evm_saa9730_unblock_lan_int':
drivers/net/saa9730.c:97: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c: In function 'show_saa9730_regs':
drivers/net/saa9730.c:150: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c: In function 'lan_saa9730_allocate_buffers':
drivers/net/saa9730.c:292: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c:295: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c:302: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c:305: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c:312: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c: In function 'lan_saa9730_cam_load':
drivers/net/saa9730.c:329: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c:332: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c: In function 'lan_saa9730_mii_init':
drivers/net/saa9730.c:369: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c:395: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c:403: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c:410: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c:432: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c: In function 'lan_saa9730_control_init':
drivers/net/saa9730.c:470: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c:474: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c:478: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c:484: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c:487: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c:490: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c:493: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c: In function 'lan_saa9730_stop':
drivers/net/saa9730.c:505: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c:508: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c:510: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c: In function 'lan_saa9730_dma_init':
drivers/net/saa9730.c:536: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c: In function 'lan_saa9730_start':
drivers/net/saa9730.c:556: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c:560: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c:564: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c:567: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c: In function 'lan_saa9730_tx':
drivers/net/saa9730.c:590: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c: In function 'lan_saa9730_rx':
drivers/net/saa9730.c:664: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c:729: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c: In function 'lan_saa9730_write':
drivers/net/saa9730.c:848: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c: In function 'lan_saa9730_set_multicast':
drivers/net/saa9730.c:943: warning: passing argument 2 of 'outl' makes integer from pointer without a cast
drivers/net/saa9730.c:949: warning: passing argument 2 of 'outl' makes integer from pointer without a cast

Fixed by using writel instead of outl.  42 warnings less.
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 6f6881b8
...@@ -64,37 +64,37 @@ static unsigned int pci_irq_line; ...@@ -64,37 +64,37 @@ static unsigned int pci_irq_line;
static void evm_saa9730_enable_lan_int(struct lan_saa9730_private *lp) static void evm_saa9730_enable_lan_int(struct lan_saa9730_private *lp)
{ {
outl(readl(&lp->evm_saa9730_regs->InterruptBlock1) | EVM_LAN_INT, writel(readl(&lp->evm_saa9730_regs->InterruptBlock1) | EVM_LAN_INT,
&lp->evm_saa9730_regs->InterruptBlock1); &lp->evm_saa9730_regs->InterruptBlock1);
outl(readl(&lp->evm_saa9730_regs->InterruptStatus1) | EVM_LAN_INT, writel(readl(&lp->evm_saa9730_regs->InterruptStatus1) | EVM_LAN_INT,
&lp->evm_saa9730_regs->InterruptStatus1); &lp->evm_saa9730_regs->InterruptStatus1);
outl(readl(&lp->evm_saa9730_regs->InterruptEnable1) | EVM_LAN_INT | writel(readl(&lp->evm_saa9730_regs->InterruptEnable1) | EVM_LAN_INT |
EVM_MASTER_EN, &lp->evm_saa9730_regs->InterruptEnable1); EVM_MASTER_EN, &lp->evm_saa9730_regs->InterruptEnable1);
} }
static void evm_saa9730_disable_lan_int(struct lan_saa9730_private *lp) static void evm_saa9730_disable_lan_int(struct lan_saa9730_private *lp)
{ {
outl(readl(&lp->evm_saa9730_regs->InterruptBlock1) & ~EVM_LAN_INT, writel(readl(&lp->evm_saa9730_regs->InterruptBlock1) & ~EVM_LAN_INT,
&lp->evm_saa9730_regs->InterruptBlock1); &lp->evm_saa9730_regs->InterruptBlock1);
outl(readl(&lp->evm_saa9730_regs->InterruptEnable1) & ~EVM_LAN_INT, writel(readl(&lp->evm_saa9730_regs->InterruptEnable1) & ~EVM_LAN_INT,
&lp->evm_saa9730_regs->InterruptEnable1); &lp->evm_saa9730_regs->InterruptEnable1);
} }
static void evm_saa9730_clear_lan_int(struct lan_saa9730_private *lp) static void evm_saa9730_clear_lan_int(struct lan_saa9730_private *lp)
{ {
outl(EVM_LAN_INT, &lp->evm_saa9730_regs->InterruptStatus1); writel(EVM_LAN_INT, &lp->evm_saa9730_regs->InterruptStatus1);
} }
static void evm_saa9730_block_lan_int(struct lan_saa9730_private *lp) static void evm_saa9730_block_lan_int(struct lan_saa9730_private *lp)
{ {
outl(readl(&lp->evm_saa9730_regs->InterruptBlock1) & ~EVM_LAN_INT, writel(readl(&lp->evm_saa9730_regs->InterruptBlock1) & ~EVM_LAN_INT,
&lp->evm_saa9730_regs->InterruptBlock1); &lp->evm_saa9730_regs->InterruptBlock1);
} }
static void evm_saa9730_unblock_lan_int(struct lan_saa9730_private *lp) static void evm_saa9730_unblock_lan_int(struct lan_saa9730_private *lp)
{ {
outl(readl(&lp->evm_saa9730_regs->InterruptBlock1) | EVM_LAN_INT, writel(readl(&lp->evm_saa9730_regs->InterruptBlock1) | EVM_LAN_INT,
&lp->evm_saa9730_regs->InterruptBlock1); &lp->evm_saa9730_regs->InterruptBlock1);
} }
static void __attribute_used__ show_saa9730_regs(struct lan_saa9730_private *lp) static void __attribute_used__ show_saa9730_regs(struct lan_saa9730_private *lp)
...@@ -147,7 +147,7 @@ static void __attribute_used__ show_saa9730_regs(struct lan_saa9730_private *lp) ...@@ -147,7 +147,7 @@ static void __attribute_used__ show_saa9730_regs(struct lan_saa9730_private *lp)
printk("lp->lan_saa9730_regs->RxStatus = %x\n", printk("lp->lan_saa9730_regs->RxStatus = %x\n",
readl(&lp->lan_saa9730_regs->RxStatus)); readl(&lp->lan_saa9730_regs->RxStatus));
for (i = 0; i < LAN_SAA9730_CAM_DWORDS; i++) { for (i = 0; i < LAN_SAA9730_CAM_DWORDS; i++) {
outl(i, &lp->lan_saa9730_regs->CamAddress); writel(i, &lp->lan_saa9730_regs->CamAddress);
printk("lp->lan_saa9730_regs->CamData = %x\n", printk("lp->lan_saa9730_regs->CamData = %x\n",
readl(&lp->lan_saa9730_regs->CamData)); readl(&lp->lan_saa9730_regs->CamData));
} }
...@@ -288,28 +288,27 @@ static int lan_saa9730_allocate_buffers(struct pci_dev *pdev, ...@@ -288,28 +288,27 @@ static int lan_saa9730_allocate_buffers(struct pci_dev *pdev,
* Set rx buffer A and rx buffer B to point to the first two buffer * Set rx buffer A and rx buffer B to point to the first two buffer
* spaces. * spaces.
*/ */
outl(lp->dma_addr + rxoffset, writel(lp->dma_addr + rxoffset, &lp->lan_saa9730_regs->RxBuffA);
&lp->lan_saa9730_regs->RxBuffA); writel(lp->dma_addr + rxoffset +
outl(lp->dma_addr + rxoffset + LAN_SAA9730_PACKET_SIZE * LAN_SAA9730_RCV_Q_SIZE,
LAN_SAA9730_PACKET_SIZE * LAN_SAA9730_RCV_Q_SIZE, &lp->lan_saa9730_regs->RxBuffB);
&lp->lan_saa9730_regs->RxBuffB);
/* /*
* Set txm_buf_a and txm_buf_b to point to the first two buffer * Set txm_buf_a and txm_buf_b to point to the first two buffer
* space * space
*/ */
outl(lp->dma_addr + txoffset, writel(lp->dma_addr + txoffset,
&lp->lan_saa9730_regs->TxBuffA); &lp->lan_saa9730_regs->TxBuffA);
outl(lp->dma_addr + txoffset + writel(lp->dma_addr + txoffset +
LAN_SAA9730_PACKET_SIZE * LAN_SAA9730_TXM_Q_SIZE, LAN_SAA9730_PACKET_SIZE * LAN_SAA9730_TXM_Q_SIZE,
&lp->lan_saa9730_regs->TxBuffB); &lp->lan_saa9730_regs->TxBuffB);
/* Set packet number */ /* Set packet number */
outl((lp->DmaRcvPackets << PK_COUNT_RX_A_SHF) | writel((lp->DmaRcvPackets << PK_COUNT_RX_A_SHF) |
(lp->DmaRcvPackets << PK_COUNT_RX_B_SHF) | (lp->DmaRcvPackets << PK_COUNT_RX_B_SHF) |
(lp->DmaTxmPackets << PK_COUNT_TX_A_SHF) | (lp->DmaTxmPackets << PK_COUNT_TX_A_SHF) |
(lp->DmaTxmPackets << PK_COUNT_TX_B_SHF), (lp->DmaTxmPackets << PK_COUNT_TX_B_SHF),
&lp->lan_saa9730_regs->PacketCount); &lp->lan_saa9730_regs->PacketCount);
return 0; return 0;
...@@ -326,10 +325,10 @@ static int lan_saa9730_cam_load(struct lan_saa9730_private *lp) ...@@ -326,10 +325,10 @@ static int lan_saa9730_cam_load(struct lan_saa9730_private *lp)
for (i = 0; i < LAN_SAA9730_CAM_DWORDS; i++) { for (i = 0; i < LAN_SAA9730_CAM_DWORDS; i++) {
/* First set address to where data is written */ /* First set address to where data is written */
outl(i, &lp->lan_saa9730_regs->CamAddress); writel(i, &lp->lan_saa9730_regs->CamAddress);
outl((NetworkAddress[0] << 24) | (NetworkAddress[1] << 16) writel((NetworkAddress[0] << 24) | (NetworkAddress[1] << 16) |
| (NetworkAddress[2] << 8) | NetworkAddress[3], (NetworkAddress[2] << 8) | NetworkAddress[3],
&lp->lan_saa9730_regs->CamData); &lp->lan_saa9730_regs->CamData);
NetworkAddress += 4; NetworkAddress += 4;
} }
return 0; return 0;
...@@ -365,8 +364,8 @@ static int lan_saa9730_mii_init(struct lan_saa9730_private *lp) ...@@ -365,8 +364,8 @@ static int lan_saa9730_mii_init(struct lan_saa9730_private *lp)
} }
/* Now set the control and address register. */ /* Now set the control and address register. */
outl(MD_CA_BUSY | PHY_STATUS | PHY_ADDRESS << MD_CA_PHY_SHF, writel(MD_CA_BUSY | PHY_STATUS | PHY_ADDRESS << MD_CA_PHY_SHF,
&lp->lan_saa9730_regs->StationMgmtCtl); &lp->lan_saa9730_regs->StationMgmtCtl);
/* check link status, spin here till station is not busy */ /* check link status, spin here till station is not busy */
i = 0; i = 0;
...@@ -391,23 +390,23 @@ static int lan_saa9730_mii_init(struct lan_saa9730_private *lp) ...@@ -391,23 +390,23 @@ static int lan_saa9730_mii_init(struct lan_saa9730_private *lp)
/* Link is down, reset the PHY first. */ /* Link is down, reset the PHY first. */
/* set PHY address = 'CONTROL' */ /* set PHY address = 'CONTROL' */
outl(PHY_ADDRESS << MD_CA_PHY_SHF | MD_CA_WR | PHY_CONTROL, writel(PHY_ADDRESS << MD_CA_PHY_SHF | MD_CA_WR | PHY_CONTROL,
&lp->lan_saa9730_regs->StationMgmtCtl); &lp->lan_saa9730_regs->StationMgmtCtl);
/* Wait for 1 ms. */ /* Wait for 1 ms. */
mdelay(1); mdelay(1);
/* set 'CONTROL' = force reset and renegotiate */ /* set 'CONTROL' = force reset and renegotiate */
outl(PHY_CONTROL_RESET | PHY_CONTROL_AUTO_NEG | writel(PHY_CONTROL_RESET | PHY_CONTROL_AUTO_NEG |
PHY_CONTROL_RESTART_AUTO_NEG, PHY_CONTROL_RESTART_AUTO_NEG,
&lp->lan_saa9730_regs->StationMgmtData); &lp->lan_saa9730_regs->StationMgmtData);
/* Wait for 50 ms. */ /* Wait for 50 ms. */
mdelay(50); mdelay(50);
/* set 'BUSY' to start operation */ /* set 'BUSY' to start operation */
outl(MD_CA_BUSY | PHY_ADDRESS << MD_CA_PHY_SHF | MD_CA_WR | writel(MD_CA_BUSY | PHY_ADDRESS << MD_CA_PHY_SHF | MD_CA_WR |
PHY_CONTROL, &lp->lan_saa9730_regs->StationMgmtCtl); PHY_CONTROL, &lp->lan_saa9730_regs->StationMgmtCtl);
/* await completion */ /* await completion */
i = 0; i = 0;
...@@ -427,9 +426,9 @@ static int lan_saa9730_mii_init(struct lan_saa9730_private *lp) ...@@ -427,9 +426,9 @@ static int lan_saa9730_mii_init(struct lan_saa9730_private *lp)
for (l = 0; l < 2; l++) { for (l = 0; l < 2; l++) {
/* set PHY address = 'STATUS' */ /* set PHY address = 'STATUS' */
outl(MD_CA_BUSY | PHY_ADDRESS << MD_CA_PHY_SHF | writel(MD_CA_BUSY | PHY_ADDRESS << MD_CA_PHY_SHF |
PHY_STATUS, PHY_STATUS,
&lp->lan_saa9730_regs->StationMgmtCtl); &lp->lan_saa9730_regs->StationMgmtCtl);
/* await completion */ /* await completion */
i = 0; i = 0;
...@@ -462,35 +461,35 @@ static int lan_saa9730_mii_init(struct lan_saa9730_private *lp) ...@@ -462,35 +461,35 @@ static int lan_saa9730_mii_init(struct lan_saa9730_private *lp)
static int lan_saa9730_control_init(struct lan_saa9730_private *lp) static int lan_saa9730_control_init(struct lan_saa9730_private *lp)
{ {
/* Initialize DMA control register. */ /* Initialize DMA control register. */
outl((LANMB_ANY << DMA_CTL_MAX_XFER_SHF) | writel((LANMB_ANY << DMA_CTL_MAX_XFER_SHF) |
(LANEND_LITTLE << DMA_CTL_ENDIAN_SHF) | (LANEND_LITTLE << DMA_CTL_ENDIAN_SHF) |
(LAN_SAA9730_RCV_Q_INT_THRESHOLD << DMA_CTL_RX_INT_COUNT_SHF) (LAN_SAA9730_RCV_Q_INT_THRESHOLD << DMA_CTL_RX_INT_COUNT_SHF)
| DMA_CTL_RX_INT_TO_EN | DMA_CTL_RX_INT_EN | | DMA_CTL_RX_INT_TO_EN | DMA_CTL_RX_INT_EN |
DMA_CTL_MAC_RX_INT_EN | DMA_CTL_MAC_TX_INT_EN, DMA_CTL_MAC_RX_INT_EN | DMA_CTL_MAC_TX_INT_EN,
&lp->lan_saa9730_regs->LanDmaCtl); &lp->lan_saa9730_regs->LanDmaCtl);
/* Initial MAC control register. */ /* Initial MAC control register. */
outl((MACCM_MII << MAC_CONTROL_CONN_SHF) | MAC_CONTROL_FULL_DUP, writel((MACCM_MII << MAC_CONTROL_CONN_SHF) | MAC_CONTROL_FULL_DUP,
&lp->lan_saa9730_regs->MacCtl); &lp->lan_saa9730_regs->MacCtl);
/* Initialize CAM control register. */ /* Initialize CAM control register. */
outl(CAM_CONTROL_COMP_EN | CAM_CONTROL_BROAD_ACC, writel(CAM_CONTROL_COMP_EN | CAM_CONTROL_BROAD_ACC,
&lp->lan_saa9730_regs->CamCtl); &lp->lan_saa9730_regs->CamCtl);
/* /*
* Initialize CAM enable register, only turn on first entry, should * Initialize CAM enable register, only turn on first entry, should
* contain own addr. * contain own addr.
*/ */
outl(0x0001, &lp->lan_saa9730_regs->CamEnable); writel(0x0001, &lp->lan_saa9730_regs->CamEnable);
/* Initialize Tx control register */ /* Initialize Tx control register */
outl(TX_CTL_EN_COMP, &lp->lan_saa9730_regs->TxCtl); writel(TX_CTL_EN_COMP, &lp->lan_saa9730_regs->TxCtl);
/* Initialize Rcv control register */ /* Initialize Rcv control register */
outl(RX_CTL_STRIP_CRC, &lp->lan_saa9730_regs->RxCtl); writel(RX_CTL_STRIP_CRC, &lp->lan_saa9730_regs->RxCtl);
/* Reset DMA engine */ /* Reset DMA engine */
outl(DMA_TEST_SW_RESET, &lp->lan_saa9730_regs->DmaTest); writel(DMA_TEST_SW_RESET, &lp->lan_saa9730_regs->DmaTest);
return 0; return 0;
} }
...@@ -500,14 +499,14 @@ static int lan_saa9730_stop(struct lan_saa9730_private *lp) ...@@ -500,14 +499,14 @@ static int lan_saa9730_stop(struct lan_saa9730_private *lp)
int i; int i;
/* Stop DMA first */ /* Stop DMA first */
outl(readl(&lp->lan_saa9730_regs->LanDmaCtl) & writel(readl(&lp->lan_saa9730_regs->LanDmaCtl) &
~(DMA_CTL_EN_TX_DMA | DMA_CTL_EN_RX_DMA), ~(DMA_CTL_EN_TX_DMA | DMA_CTL_EN_RX_DMA),
&lp->lan_saa9730_regs->LanDmaCtl); &lp->lan_saa9730_regs->LanDmaCtl);
/* Set the SW Reset bits in DMA and MAC control registers */ /* Set the SW Reset bits in DMA and MAC control registers */
outl(DMA_TEST_SW_RESET, &lp->lan_saa9730_regs->DmaTest); writel(DMA_TEST_SW_RESET, &lp->lan_saa9730_regs->DmaTest);
outl(readl(&lp->lan_saa9730_regs->MacCtl) | MAC_CONTROL_RESET, writel(readl(&lp->lan_saa9730_regs->MacCtl) | MAC_CONTROL_RESET,
&lp->lan_saa9730_regs->MacCtl); &lp->lan_saa9730_regs->MacCtl);
/* /*
* Wait for MAC reset to have finished. The reset bit is auto cleared * Wait for MAC reset to have finished. The reset bit is auto cleared
...@@ -532,8 +531,8 @@ static int lan_saa9730_dma_init(struct lan_saa9730_private *lp) ...@@ -532,8 +531,8 @@ static int lan_saa9730_dma_init(struct lan_saa9730_private *lp)
/* Stop lan controller. */ /* Stop lan controller. */
lan_saa9730_stop(lp); lan_saa9730_stop(lp);
outl(LAN_SAA9730_DEFAULT_TIME_OUT_CNT, writel(LAN_SAA9730_DEFAULT_TIME_OUT_CNT,
&lp->lan_saa9730_regs->Timeout); &lp->lan_saa9730_regs->Timeout);
return 0; return 0;
} }
...@@ -552,19 +551,19 @@ static int lan_saa9730_start(struct lan_saa9730_private *lp) ...@@ -552,19 +551,19 @@ static int lan_saa9730_start(struct lan_saa9730_private *lp)
lp->PendingTxmPacketIndex = 0; lp->PendingTxmPacketIndex = 0;
lp->PendingTxmBufferIndex = 0; lp->PendingTxmBufferIndex = 0;
outl(readl(&lp->lan_saa9730_regs->LanDmaCtl) | DMA_CTL_EN_TX_DMA | writel(readl(&lp->lan_saa9730_regs->LanDmaCtl) | DMA_CTL_EN_TX_DMA |
DMA_CTL_EN_RX_DMA, &lp->lan_saa9730_regs->LanDmaCtl); DMA_CTL_EN_RX_DMA, &lp->lan_saa9730_regs->LanDmaCtl);
/* For Tx, turn on MAC then DMA */ /* For Tx, turn on MAC then DMA */
outl(readl(&lp->lan_saa9730_regs->TxCtl) | TX_CTL_TX_EN, writel(readl(&lp->lan_saa9730_regs->TxCtl) | TX_CTL_TX_EN,
&lp->lan_saa9730_regs->TxCtl); &lp->lan_saa9730_regs->TxCtl);
/* For Rx, turn on DMA then MAC */ /* For Rx, turn on DMA then MAC */
outl(readl(&lp->lan_saa9730_regs->RxCtl) | RX_CTL_RX_EN, writel(readl(&lp->lan_saa9730_regs->RxCtl) | RX_CTL_RX_EN,
&lp->lan_saa9730_regs->RxCtl); &lp->lan_saa9730_regs->RxCtl);
/* Set Ok2Use to let hardware own the buffers. */ /* Set Ok2Use to let hardware own the buffers. */
outl(OK2USE_RX_A | OK2USE_RX_B, &lp->lan_saa9730_regs->Ok2Use); writel(OK2USE_RX_A | OK2USE_RX_B, &lp->lan_saa9730_regs->Ok2Use);
return 0; return 0;
} }
...@@ -587,7 +586,7 @@ static int lan_saa9730_tx(struct net_device *dev) ...@@ -587,7 +586,7 @@ static int lan_saa9730_tx(struct net_device *dev)
printk("lan_saa9730_tx interrupt\n"); printk("lan_saa9730_tx interrupt\n");
/* Clear interrupt. */ /* Clear interrupt. */
outl(DMA_STATUS_MAC_TX_INT, &lp->lan_saa9730_regs->DmaStatus); writel(DMA_STATUS_MAC_TX_INT, &lp->lan_saa9730_regs->DmaStatus);
while (1) { while (1) {
pPacket = lp->TxmBuffer[lp->PendingTxmBufferIndex] pPacket = lp->TxmBuffer[lp->PendingTxmBufferIndex]
...@@ -660,8 +659,8 @@ static int lan_saa9730_rx(struct net_device *dev) ...@@ -660,8 +659,8 @@ static int lan_saa9730_rx(struct net_device *dev)
printk("lan_saa9730_rx interrupt\n"); printk("lan_saa9730_rx interrupt\n");
/* Clear receive interrupts. */ /* Clear receive interrupts. */
outl(DMA_STATUS_MAC_RX_INT | DMA_STATUS_RX_INT | writel(DMA_STATUS_MAC_RX_INT | DMA_STATUS_RX_INT |
DMA_STATUS_RX_TO_INT, &lp->lan_saa9730_regs->DmaStatus); DMA_STATUS_RX_TO_INT, &lp->lan_saa9730_regs->DmaStatus);
/* Address next packet */ /* Address next packet */
BufferIndex = lp->NextRcvBufferIndex; BufferIndex = lp->NextRcvBufferIndex;
...@@ -725,8 +724,8 @@ static int lan_saa9730_rx(struct net_device *dev) ...@@ -725,8 +724,8 @@ static int lan_saa9730_rx(struct net_device *dev)
*pPacket = cpu_to_le32(RXSF_READY << RX_STAT_CTL_OWNER_SHF); *pPacket = cpu_to_le32(RXSF_READY << RX_STAT_CTL_OWNER_SHF);
/* Make sure A or B is available to hardware as appropriate. */ /* Make sure A or B is available to hardware as appropriate. */
outl(BufferIndex ? OK2USE_RX_B : OK2USE_RX_A, writel(BufferIndex ? OK2USE_RX_B : OK2USE_RX_A,
&lp->lan_saa9730_regs->Ok2Use); &lp->lan_saa9730_regs->Ok2Use);
/* Go to next packet in sequence. */ /* Go to next packet in sequence. */
lp->NextRcvPacketIndex++; lp->NextRcvPacketIndex++;
...@@ -844,8 +843,8 @@ static int lan_saa9730_write(struct lan_saa9730_private *lp, ...@@ -844,8 +843,8 @@ static int lan_saa9730_write(struct lan_saa9730_private *lp,
(len << TX_STAT_CTL_LENGTH_SHF)); (len << TX_STAT_CTL_LENGTH_SHF));
/* Make sure A or B is available to hardware as appropriate. */ /* Make sure A or B is available to hardware as appropriate. */
outl(BufferIndex ? OK2USE_TX_B : OK2USE_TX_A, writel(BufferIndex ? OK2USE_TX_B : OK2USE_TX_A,
&lp->lan_saa9730_regs->Ok2Use); &lp->lan_saa9730_regs->Ok2Use);
return 0; return 0;
} }
...@@ -938,15 +937,15 @@ static void lan_saa9730_set_multicast(struct net_device *dev) ...@@ -938,15 +937,15 @@ static void lan_saa9730_set_multicast(struct net_device *dev)
if (dev->flags & IFF_PROMISC) { if (dev->flags & IFF_PROMISC) {
/* accept all packets */ /* accept all packets */
outl(CAM_CONTROL_COMP_EN | CAM_CONTROL_STATION_ACC | writel(CAM_CONTROL_COMP_EN | CAM_CONTROL_STATION_ACC |
CAM_CONTROL_GROUP_ACC | CAM_CONTROL_BROAD_ACC, CAM_CONTROL_GROUP_ACC | CAM_CONTROL_BROAD_ACC,
&lp->lan_saa9730_regs->CamCtl); &lp->lan_saa9730_regs->CamCtl);
} else { } else {
if (dev->flags & IFF_ALLMULTI) { if (dev->flags & IFF_ALLMULTI) {
/* accept all multicast packets */ /* accept all multicast packets */
outl(CAM_CONTROL_COMP_EN | CAM_CONTROL_GROUP_ACC | writel(CAM_CONTROL_COMP_EN | CAM_CONTROL_GROUP_ACC |
CAM_CONTROL_BROAD_ACC, CAM_CONTROL_BROAD_ACC,
&lp->lan_saa9730_regs->CamCtl); &lp->lan_saa9730_regs->CamCtl);
} else { } else {
/* /*
* Will handle the multicast stuff later. -carstenl * Will handle the multicast stuff later. -carstenl
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment