aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ucc_geth.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ucc_geth.c')
-rw-r--r--drivers/net/ucc_geth.c37
1 files changed, 30 insertions, 7 deletions
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 4ffd8739f8b7..fba0811d2608 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -2084,8 +2084,10 @@ static void ucc_geth_memclean(struct ucc_geth_private *ugeth)
2084 if (!ugeth) 2084 if (!ugeth)
2085 return; 2085 return;
2086 2086
2087 if (ugeth->uccf) 2087 if (ugeth->uccf) {
2088 ucc_fast_free(ugeth->uccf); 2088 ucc_fast_free(ugeth->uccf);
2089 ugeth->uccf = NULL;
2090 }
2089 2091
2090 if (ugeth->p_thread_data_tx) { 2092 if (ugeth->p_thread_data_tx) {
2091 qe_muram_free(ugeth->thread_dat_tx_offset); 2093 qe_muram_free(ugeth->thread_dat_tx_offset);
@@ -2305,10 +2307,6 @@ static int ucc_struct_init(struct ucc_geth_private *ugeth)
2305 ug_info = ugeth->ug_info; 2307 ug_info = ugeth->ug_info;
2306 uf_info = &ug_info->uf_info; 2308 uf_info = &ug_info->uf_info;
2307 2309
2308 /* Create CQs for hash tables */
2309 INIT_LIST_HEAD(&ugeth->group_hash_q);
2310 INIT_LIST_HEAD(&ugeth->ind_hash_q);
2311
2312 if (!((uf_info->bd_mem_part == MEM_PART_SYSTEM) || 2310 if (!((uf_info->bd_mem_part == MEM_PART_SYSTEM) ||
2313 (uf_info->bd_mem_part == MEM_PART_MURAM))) { 2311 (uf_info->bd_mem_part == MEM_PART_MURAM))) {
2314 if (netif_msg_probe(ugeth)) 2312 if (netif_msg_probe(ugeth))
@@ -3668,6 +3666,23 @@ static irqreturn_t ucc_geth_irq_handler(int irq, void *info)
3668 return IRQ_HANDLED; 3666 return IRQ_HANDLED;
3669} 3667}
3670 3668
3669#ifdef CONFIG_NET_POLL_CONTROLLER
3670/*
3671 * Polling 'interrupt' - used by things like netconsole to send skbs
3672 * without having to re-enable interrupts. It's not called while
3673 * the interrupt routine is executing.
3674 */
3675static void ucc_netpoll(struct net_device *dev)
3676{
3677 struct ucc_geth_private *ugeth = netdev_priv(dev);
3678 int irq = ugeth->ug_info->uf_info.irq;
3679
3680 disable_irq(irq);
3681 ucc_geth_irq_handler(irq, dev);
3682 enable_irq(irq);
3683}
3684#endif /* CONFIG_NET_POLL_CONTROLLER */
3685
3671/* Called when something needs to use the ethernet device */ 3686/* Called when something needs to use the ethernet device */
3672/* Returns 0 for success. */ 3687/* Returns 0 for success. */
3673static int ucc_geth_open(struct net_device *dev) 3688static int ucc_geth_open(struct net_device *dev)
@@ -3990,6 +4005,10 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
3990 ugeth = netdev_priv(dev); 4005 ugeth = netdev_priv(dev);
3991 spin_lock_init(&ugeth->lock); 4006 spin_lock_init(&ugeth->lock);
3992 4007
4008 /* Create CQs for hash tables */
4009 INIT_LIST_HEAD(&ugeth->group_hash_q);
4010 INIT_LIST_HEAD(&ugeth->ind_hash_q);
4011
3993 dev_set_drvdata(device, dev); 4012 dev_set_drvdata(device, dev);
3994 4013
3995 /* Set the dev->base_addr to the gfar reg region */ 4014 /* Set the dev->base_addr to the gfar reg region */
@@ -4006,6 +4025,9 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
4006#ifdef CONFIG_UGETH_NAPI 4025#ifdef CONFIG_UGETH_NAPI
4007 netif_napi_add(dev, &ugeth->napi, ucc_geth_poll, UCC_GETH_DEV_WEIGHT); 4026 netif_napi_add(dev, &ugeth->napi, ucc_geth_poll, UCC_GETH_DEV_WEIGHT);
4008#endif /* CONFIG_UGETH_NAPI */ 4027#endif /* CONFIG_UGETH_NAPI */
4028#ifdef CONFIG_NET_POLL_CONTROLLER
4029 dev->poll_controller = ucc_netpoll;
4030#endif
4009 dev->stop = ucc_geth_close; 4031 dev->stop = ucc_geth_close;
4010// dev->change_mtu = ucc_geth_change_mtu; 4032// dev->change_mtu = ucc_geth_change_mtu;
4011 dev->mtu = 1500; 4033 dev->mtu = 1500;
@@ -4040,9 +4062,10 @@ static int ucc_geth_remove(struct of_device* ofdev)
4040 struct net_device *dev = dev_get_drvdata(device); 4062 struct net_device *dev = dev_get_drvdata(device);
4041 struct ucc_geth_private *ugeth = netdev_priv(dev); 4063 struct ucc_geth_private *ugeth = netdev_priv(dev);
4042 4064
4043 dev_set_drvdata(device, NULL); 4065 unregister_netdev(dev);
4044 ucc_geth_memclean(ugeth);
4045 free_netdev(dev); 4066 free_netdev(dev);
4067 ucc_geth_memclean(ugeth);
4068 dev_set_drvdata(device, NULL);
4046 4069
4047 return 0; 4070 return 0;
4048} 4071}