projects
/
openwrt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tahvo doesn't need ohci
[openwrt.git]
/
target
/
linux
/
ramips
/
files
/
drivers
/
net
/
ramips.c
diff --git
a/target/linux/ramips/files/drivers/net/ramips.c
b/target/linux/ramips/files/drivers/net/ramips.c
index
1f3c35a
..
63570c7
100644
(file)
--- a/
target/linux/ramips/files/drivers/net/ramips.c
+++ b/
target/linux/ramips/files/drivers/net/ramips.c
@@
-33,6
+33,9
@@
#ifdef CONFIG_RALINK_RT305X
#include "ramips_esw.c"
#ifdef CONFIG_RALINK_RT305X
#include "ramips_esw.c"
+#else
+static inline int rt305x_esw_init(void) { return 0; }
+static inline void rt305x_esw_exit(void) { }
#endif
#define phys_to_bus(a) (a & 0x1FFFFFFF)
#endif
#define phys_to_bus(a) (a & 0x1FFFFFFF)
@@
-169,12
+172,13
@@
ramips_alloc_dma(struct raeth_priv *re)
memset(re->rx, 0, sizeof(struct ramips_rx_dma) * NUM_RX_DESC);
for (i = 0; i < NUM_RX_DESC; i++) {
memset(re->rx, 0, sizeof(struct ramips_rx_dma) * NUM_RX_DESC);
for (i = 0; i < NUM_RX_DESC; i++) {
- struct sk_buff *new_skb = dev_alloc_skb(MAX_RX_LENGTH + 2);
+ struct sk_buff *new_skb = dev_alloc_skb(MAX_RX_LENGTH +
+ NET_IP_ALIGN);
if (!new_skb)
goto err_cleanup;
if (!new_skb)
goto err_cleanup;
- skb_reserve(new_skb,
2
);
+ skb_reserve(new_skb,
NET_IP_ALIGN
);
re->rx[i].rxd1 = dma_map_single(NULL,
new_skb->data,
MAX_RX_LENGTH,
re->rx[i].rxd1 = dma_map_single(NULL,
new_skb->data,
MAX_RX_LENGTH,
@@
-272,7
+276,7
@@
ramips_eth_rx_hw(unsigned long ptr)
break;
max_rx--;
break;
max_rx--;
- new_skb = netdev_alloc_skb(dev, MAX_RX_LENGTH +
2
);
+ new_skb = netdev_alloc_skb(dev, MAX_RX_LENGTH +
NET_IP_ALIGN
);
/* Reuse the buffer on allocation failures */
if (new_skb) {
rx_skb = priv->rx_skb[rx];
/* Reuse the buffer on allocation failures */
if (new_skb) {
rx_skb = priv->rx_skb[rx];
@@
-285,7
+289,7
@@
ramips_eth_rx_hw(unsigned long ptr)
netif_rx(rx_skb);
priv->rx_skb[rx] = new_skb;
netif_rx(rx_skb);
priv->rx_skb[rx] = new_skb;
- skb_reserve(new_skb,
2
);
+ skb_reserve(new_skb,
NET_IP_ALIGN
);
priv->rx[rx].rxd1 = dma_map_single(NULL,
new_skb->data,
MAX_RX_LENGTH,
priv->rx[rx].rxd1 = dma_map_single(NULL,
new_skb->data,
MAX_RX_LENGTH,
@@
-506,9
+510,6
@@
ramips_eth_plat_probe(struct platform_device *plat)
goto err_free_dev;
}
goto err_free_dev;
}
-#ifdef CONFIG_RALINK_RT305X
- rt305x_esw_init();
-#endif
printk(KERN_DEBUG "ramips_eth: loaded\n");
return 0;
printk(KERN_DEBUG "ramips_eth: loaded\n");
return 0;
@@
-540,10
+541,23
@@
static struct platform_driver ramips_eth_driver = {
static int __init
ramips_eth_init(void)
{
static int __init
ramips_eth_init(void)
{
- int ret = platform_driver_register(&ramips_eth_driver);
+ int ret;
+
+ ret = rt305x_esw_init();
if (ret)
if (ret)
+ return ret;
+
+ ret = platform_driver_register(&ramips_eth_driver);
+ if (ret) {
printk(KERN_ERR
"ramips_eth: Error registering platfom driver!\n");
printk(KERN_ERR
"ramips_eth: Error registering platfom driver!\n");
+ goto esw_cleanup;
+ }
+
+ return 0;
+
+esw_cleanup:
+ rt305x_esw_exit();
return ret;
}
return ret;
}
@@
-551,6
+565,7
@@
static void __exit
ramips_eth_cleanup(void)
{
platform_driver_unregister(&ramips_eth_driver);
ramips_eth_cleanup(void)
{
platform_driver_unregister(&ramips_eth_driver);
+ rt305x_esw_exit();
}
module_init(ramips_eth_init);
}
module_init(ramips_eth_init);
This page took
0.022488 seconds
and
4
git commands to generate.