From patchwork Thu Apr 21 12:21:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Galbusera X-Patchwork-Id: 92401 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 8D879100A6B for ; Thu, 21 Apr 2011 22:21:56 +1000 (EST) Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id D876EB6F4F for ; Thu, 21 Apr 2011 22:21:44 +1000 (EST) Received: by wwi36 with SMTP id 36so1814856wwi.14 for ; Thu, 21 Apr 2011 05:21:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer; bh=3Cr34ZqnkvyJkc9RbLIBimyfT2tyHs3jw83897dUPhg=; b=UD9wjJPBvTEVFveMYAo52yqKONXskSCuk8ODcJM+lysHmxA/uQ6gs0NfdmwZG1aSqS LDuspvp+ZZ677vmWuItDo7jblB05BBJ4AETbYgxP9EP3+TPjLUNrj061h/9Z4DSeC1JL OiPAtwG2/Pqjp8f3raEiRPYbPqh5Nat+4gWXg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=YDCLI3OtyWF194Ca7tqrMxp5XSxwNvLKeAobxgRcpXhn24jbpVtIph0Yl/Ay9qdc1F YE6RT2g2OvN0ny7wxiYigfFUFrvtkiZylf7VwOEmd/BvKF2lvxoiVZsN+xO5AVMxj4z4 7q+f3NFdg44POc7WqfR4rA27pb0YZwZUU+odQ= Received: by 10.227.201.9 with SMTP id ey9mr3615736wbb.41.1303388498506; Thu, 21 Apr 2011 05:21:38 -0700 (PDT) Received: from localhost.localdomain (host168-65-static.12-87-b.business.telecomitalia.it [87.12.65.168]) by mx.google.com with ESMTPS id x1sm1161572wbh.2.2011.04.21.05.21.36 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 21 Apr 2011 05:21:37 -0700 (PDT) From: Andrea Galbusera To: Pantelis Antoniou , Vitaly Bordug , Scott Wood Subject: [PATCH v2 1/1] powerpc: Fix multicast problem in fs_enet driver Date: Thu, 21 Apr 2011 14:21:21 +0200 Message-Id: <1303388481-17993-1-git-send-email-gizero@gmail.com> X-Mailer: git-send-email 1.7.0.4 Cc: netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Andrea Galbusera X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.14 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-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org mac-fec.c was setting individual UDP address registers instead of multicast group address registers when joining a multicast group. This prevented from correctly receiving UDP multicast packets. According to datasheet, replaced hash_table_high and hash_table_low with grp_hash_table_high and grp_hash_table_low respectively. Also renamed hash_table_* with grp_hash_table_* in struct fec declaration for 8xx: these registers are used only for multicast there. Tested on a MPC5121 based board. Build tested also against mpc866_ads_defconfig. Signed-off-by: Andrea Galbusera --- Changes since v1: Applied comments by Scott Wood to fix 8xx broken build with v1 arch/powerpc/include/asm/8xx_immap.h | 4 ++-- drivers/net/fs_enet/mac-fec.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/include/asm/8xx_immap.h b/arch/powerpc/include/asm/8xx_immap.h index 6b6dc20..bdf0563 100644 --- a/arch/powerpc/include/asm/8xx_immap.h +++ b/arch/powerpc/include/asm/8xx_immap.h @@ -393,8 +393,8 @@ typedef struct fec { uint fec_addr_low; /* lower 32 bits of station address */ ushort fec_addr_high; /* upper 16 bits of station address */ ushort res1; /* reserved */ - uint fec_hash_table_high; /* upper 32-bits of hash table */ - uint fec_hash_table_low; /* lower 32-bits of hash table */ + uint fec_grp_hash_table_high; /* upper 32-bits of hash table */ + uint fec_grp_hash_table_low; /* lower 32-bits of hash table */ uint fec_r_des_start; /* beginning of Rx descriptor ring */ uint fec_x_des_start; /* beginning of Tx descriptor ring */ uint fec_r_buff_size; /* Rx buffer size */ diff --git a/drivers/net/fs_enet/mac-fec.c b/drivers/net/fs_enet/mac-fec.c index 61035fc..b9fbc83 100644 --- a/drivers/net/fs_enet/mac-fec.c +++ b/drivers/net/fs_enet/mac-fec.c @@ -226,8 +226,8 @@ static void set_multicast_finish(struct net_device *dev) } FC(fecp, r_cntrl, FEC_RCNTRL_PROM); - FW(fecp, hash_table_high, fep->fec.hthi); - FW(fecp, hash_table_low, fep->fec.htlo); + FW(fecp, grp_hash_table_high, fep->fec.hthi); + FW(fecp, grp_hash_table_low, fep->fec.htlo); } static void set_multicast_list(struct net_device *dev) @@ -273,8 +273,8 @@ static void restart(struct net_device *dev) /* * Reset all multicast. */ - FW(fecp, hash_table_high, fep->fec.hthi); - FW(fecp, hash_table_low, fep->fec.htlo); + FW(fecp, grp_hash_table_high, fep->fec.hthi); + FW(fecp, grp_hash_table_low, fep->fec.htlo); /* * Set maximum receive buffer size.