From patchwork Fri Mar 22 16:33:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Tjernlund X-Patchwork-Id: 230123 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id EBAEA2C012E for ; Sat, 23 Mar 2013 03:35:07 +1100 (EST) Received: from gw1.transmode.se (gw1.transmode.se [195.58.98.146]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 802032C00BC for ; Sat, 23 Mar 2013 03:34:03 +1100 (EST) Received: from mail1.transmode.se (mail1.transmode.se [192.168.201.18]) by gw1.transmode.se (Postfix) with ESMTP id 9015425801C for ; Fri, 22 Mar 2013 17:33:56 +0100 (CET) Received: from gentoo-jocke.transmode.se ([172.20.4.10]) by mail1.transmode.se (Lotus Domino Release 8.5.3FP1) with ESMTP id 2013032217335614-160985 ; Fri, 22 Mar 2013 17:33:56 +0100 Received: from gentoo-jocke.transmode.se (localhost [127.0.0.1]) by gentoo-jocke.transmode.se (8.14.4/8.14.4) with ESMTP id r2MGXur0029910; Fri, 22 Mar 2013 17:33:56 +0100 Received: (from jocke@localhost) by gentoo-jocke.transmode.se (8.14.4/8.14.4/Submit) id r2MGXtFn029908; Fri, 22 Mar 2013 17:33:55 +0100 From: Joakim Tjernlund To: Subject: RFC [PATCH] ucc_geth: impl. support for IFF_UNICAST_FLT Date: Fri, 22 Mar 2013 17:33:48 +0100 Message-Id: <1363970028-29869-1-git-send-email-Joakim.Tjernlund@transmode.se> X-Mailer: git-send-email 1.8.1.5 X-MIMETrack: Itemize by SMTP Server on mail1/Transmode(Release 8.5.3FP1|March 07, 2012) at 22/03/2013 17:33:56, Serialize by Router on mail1/Transmode(Release 8.5.3FP1|March 07, 2012) at 22/03/2013 17:33:56, Serialize complete at 22/03/2013 17:33:56 X-TNEFEvaluated: 1 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" --- I took a stab at impl. IFF_UNICAST_FLT as an exercise but I didn't get around to test it. So I figured perhaps someone else wants/need it so here is a start. With any luck it will work as is. This is on 3.0 so it might not apply without tweaks. drivers/net/ethernet/freescale/ucc_geth.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c index 3d92823..c6eac9b 100644 --- a/drivers/net/ethernet/freescale/ucc_geth.c +++ b/drivers/net/ethernet/freescale/ucc_geth.c @@ -2039,12 +2039,13 @@ static void ucc_geth_memclean(struct ucc_geth_private *ugeth) skb_queue_purge(&ugeth->rx_recycle); } -static void ucc_geth_set_multi(struct net_device *dev) +static void ucc_geth_set_rx_mode(struct net_device *dev) { struct ucc_geth_private *ugeth; struct netdev_hw_addr *ha; struct ucc_fast __iomem *uf_regs; struct ucc_geth_82xx_address_filtering_pram __iomem *p_82xx_addr_filt; + int i; ugeth = netdev_priv(dev); @@ -2059,6 +2060,22 @@ static void ucc_geth_set_multi(struct net_device *dev) (struct ucc_geth_82xx_address_filtering_pram __iomem *) ugeth-> p_rx_glbl_pram->addressfiltering; + /* Clear filter and add the addresses in the list. + */ + out_be32(&p_82xx_addr_filt->iaddr_h, 0x0); + out_be32(&p_82xx_addr_filt->iaddr_l, 0x0); + i = 0; + netdev_for_each_uc_addr(ha, dev) { + if ( i < NUM_OF_PADDRS ) + set_mac_addr(&p_82xx_addr_filt->paddr[i].h, ha->addr); + else + hw_add_addr_in_hash(ugeth, ha->addr); + i++; + } + /* Pad remaining entries with station address */ + for(; i < NUM_OF_PADDRS; i++) + set_mac_addr(&p_82xx_addr_filt->paddr[i].h, dev->dev_addr); + if (dev->flags & IFF_ALLMULTI) { /* Catch all multicast addresses, so set the * filter to all 1's. @@ -3807,7 +3824,7 @@ static const struct net_device_ops ucc_geth_netdev_ops = { .ndo_validate_addr = eth_validate_addr, .ndo_set_mac_address = ucc_geth_set_mac_addr, .ndo_change_mtu = eth_change_mtu, - .ndo_set_rx_mode = ucc_geth_set_multi, + .ndo_set_rx_mode = ucc_geth_set_rx_mode, .ndo_tx_timeout = ucc_geth_timeout, .ndo_do_ioctl = ucc_geth_ioctl, #ifdef CONFIG_NET_POLL_CONTROLLER @@ -4017,6 +4034,7 @@ static int ucc_geth_probe(struct platform_device* ofdev) ugeth->msg_enable = netif_msg_init(debug.msg_enable, UGETH_MSG_DEFAULT); ugeth->phy_interface = phy_interface; ugeth->max_speed = max_speed; + dev->priv_flags |= IFF_UNICAST_FLT; err = register_netdev(dev); if (err) {