diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2007-09-01 21:27:18 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2007-10-15 18:53:37 +0100 |
commit | 073ac8fd4a3e9a9265e8a59e0a79bc4b0b3822c3 (patch) | |
tree | 2abd149145f8dc579ccd354b95394050d590cdc2 /drivers/net/smc91x.c | |
parent | 97d97224ff361e08777fb33e0fd193ca877dac28 (diff) | |
download | op-kernel-dev-073ac8fd4a3e9a9265e8a59e0a79bc4b0b3822c3.zip op-kernel-dev-073ac8fd4a3e9a9265e8a59e0a79bc4b0b3822c3.tar.gz |
[NET] smc91x: fix PXA DMA support code
The PXA DMA support code for smc91x doesn't pass a struct device to
the dma_*map_single() functions, which leads to an oops in the dma
bounce code. We have a struct device which was used to probe the
SMC chip. Use it.
(This patch is slightly larger because it requires struct smc_local
to move into the header file.)
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/net/smc91x.c')
-rw-r--r-- | drivers/net/smc91x.c | 55 |
1 files changed, 7 insertions, 48 deletions
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c index 24e610e..7da7589 100644 --- a/drivers/net/smc91x.c +++ b/drivers/net/smc91x.c @@ -173,49 +173,6 @@ MODULE_LICENSE("GPL"); */ #define MII_DELAY 1 -/* store this information for the driver.. */ -struct smc_local { - /* - * If I have to wait until memory is available to send a - * packet, I will store the skbuff here, until I get the - * desired memory. Then, I'll send it out and free it. - */ - struct sk_buff *pending_tx_skb; - struct tasklet_struct tx_task; - - /* version/revision of the SMC91x chip */ - int version; - - /* Contains the current active transmission mode */ - int tcr_cur_mode; - - /* Contains the current active receive mode */ - int rcr_cur_mode; - - /* Contains the current active receive/phy mode */ - int rpc_cur_mode; - int ctl_rfduplx; - int ctl_rspeed; - - u32 msg_enable; - u32 phy_type; - struct mii_if_info mii; - - /* work queue */ - struct work_struct phy_configure; - struct net_device *dev; - int work_pending; - - spinlock_t lock; - -#ifdef SMC_USE_PXA_DMA - /* DMA needs the physical address of the chip */ - u_long physaddr; -#endif - void __iomem *base; - void __iomem *datacs; -}; - #if SMC_DEBUG > 0 #define DBG(n, args...) \ do { \ @@ -2215,17 +2172,19 @@ static int smc_drv_probe(struct platform_device *pdev) goto out_release_attrib; } - platform_set_drvdata(pdev, ndev); - ret = smc_probe(ndev, addr); - if (ret != 0) - goto out_iounmap; #ifdef SMC_USE_PXA_DMA - else { + { struct smc_local *lp = netdev_priv(ndev); + lp->device = &pdev->dev; lp->physaddr = res->start; } #endif + platform_set_drvdata(pdev, ndev); + ret = smc_probe(ndev, addr); + if (ret != 0) + goto out_iounmap; + smc_request_datacs(pdev, ndev); return 0; |