* set_multicast_list function of ppc enet driver
@ 2002-06-19 10:42 Ludszuweit, Axel
2002-06-19 11:23 ` Steffen Rumler
0 siblings, 1 reply; 3+ messages in thread
From: Ludszuweit, Axel @ 2002-06-19 10:42 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 917 bytes --]
Hello,
I have a question about the powerquicc ethernet
drivers, especcially to the set_multicast_list
routine.
In this routine, only one multicast address
is used, to evaluate the appropriate hash value.
I dont know, how the dmi structure works, but I have
took a look to other drivers.
In my opinion, dev->dmi is the start point
of dev->mc_count chained dmi structures,
which contains all multicast addresses.
I have attached a patch of the 8260 version of
enet.c, which will take this in account.
I dont have tested the patch.
Have someone experience with the multicast feature
and can give me some feedback?
Thanks
--------------------------------------------
Datentechnik Intercom GmbH
Axel Ludszuweit
Frankenring 14
D-30855 Langenhagen
Telefon: +49(0)511 978197-630
Telefax: +49 511 / 978197-670
mailto:axel.ludszuweit@datentechnik.com
http://www.datentechnik.com
[-- Attachment #2: patch_enet.c --]
[-- Type: application/octet-stream, Size: 470 bytes --]
--- linux-2.4.18/arch/ppc/8260_io/enet.c.ORIG Wed Jun 19 10:44:16 2002
+++ linux-2.4.18/arch/ppc/8260_io/enet.c Wed Jun 19 11:03:38 2002
@@ -577,9 +577,10 @@
ep->sen_gaddr3 = 0;
ep->sen_gaddr4 = 0;
- dmi = dev->mc_list;
- for (i=0; i<dev->mc_count; i++) {
+ for (i=0, dmi = dev->mc_list;
+ i < dev->mc_count && (dmi != (struct dev_mc_list *) NULL);
+ i++, dmi = dmi->next) {
/* Only support group multicast for now.
*/
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: set_multicast_list function of ppc enet driver
2002-06-19 10:42 set_multicast_list function of ppc enet driver Ludszuweit, Axel
@ 2002-06-19 11:23 ` Steffen Rumler
2002-06-19 11:31 ` Steffen Rumler
0 siblings, 1 reply; 3+ messages in thread
From: Steffen Rumler @ 2002-06-19 11:23 UTC (permalink / raw)
To: Ludszuweit, Axel; +Cc: linuxppc-embedded
> I have a question about the powerquicc ethernet
> drivers, especcially to the set_multicast_list
> routine.
> In this routine, only one multicast address
> is used, to evaluate the appropriate hash value.
> I dont know, how the dmi structure works, but I have
> took a look to other drivers.
> In my opinion, dev->dmi is the start point
> of dev->mc_count chained dmi structures,
> which contains all multicast addresses.
> I have attached a patch of the 8260 version of
> enet.c, which will take this in account.
> I dont have tested the patch.
> Have someone experience with the multicast feature
> and can give me some feedback?
I agree with you. For the version of the fcc_enet.c (for MPC8260)
passed with the 2.4.3 kernel the set_multicast_list()
routine was incomplete and not working.
Via the dmi list the complete set of multicast groups
actually joined will be presented, every time a process joins or
dis-joins a new multicast group. This is fine, because the
driver has not record it in SW.
I pass you also my fixed version for the FCC.
Steffen Rumler
static void
set_multicast_list (struct net_device *dev)
{
struct fcc_enet_private *cep;
struct dev_mc_list *dmi;
u_char *mcptr, *tdptr;
volatile fcc_enet_t *ep;
int i, j;
cep = (struct fcc_enet_private *)dev->priv;
/* Get pointer to FCC area in parameter RAM.
*/
ep = (fcc_enet_t *)dev->base_addr;
if (dev->flags&IFF_PROMISC) {
/* Log any net taps. */
printk("%s: Promiscuous mode enabled.\n", dev->name);
cep->fccp->fcc_fpsmr |= FCC_PSMR_PRO;
} else {
cep->fccp->fcc_fpsmr &= ~FCC_PSMR_PRO;
if (dev->flags & IFF_ALLMULTI) {
/* Catch all multicast addresses, so set the
* filter to all 1's.
*/
ep->fen_gaddrh = 0xffffffff;
ep->fen_gaddrl = 0xffffffff;
}
else {
/* Clear filter and add the addresses in the list.
*/
ep->fen_gaddrh = 0;
ep->fen_gaddrl = 0;
dmi = dev->mc_list;
for (i=0; i<dev->mc_count; i++) {
/* Only support group multicast for now.
*/
if (!(dmi->dmi_addr[0] & 1))
continue;
/* The address in dmi_addr is LSB first,
* and taddr is MSB first. We have to
* copy bytes MSB first from dmi_addr.
*/
mcptr = (u_char *)dmi->dmi_addr + 5;
tdptr = (u_char *)&ep->fen_taddrh;
for (j=0; j<6; j++)
*tdptr++ = *mcptr--;
/* Ask CPM to run CRC and set bit in
* filter mask.
*/
#ifdef CONFIG_MCU
run_cpcr_cmd(cep->fip->fc_cpmpage,
cep->fip->fc_cpmblock,
0x0c,
CPM_CR_SET_GADDR);
#else /* CONFIG_MCU */
cpmp->cp_cpcr = mk_cr_cmd(cep->fip->fc_cpmpage,
cep->fip->fc_cpmblock, 0x0c,
CPM_CR_SET_GADDR) | CPM_CR_FLG;
udelay(10);
while (cpmp->cp_cpcr & CPM_CR_FLG);
#endif /* CONFIG_MCU */
}
}
}
}
--
--------------------------------------------------------------
Steffen Rumler
ICN ON PNE SB 4
Siemens AG
Hofmannstr. 51 Email: Steffen.Rumler@icn.siemens.de
D-81359 Munich Phone: +49 89 722-44061
Germany Fax : +49 89 722-36703
--------------------------------------------------------------
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: set_multicast_list function of ppc enet driver
2002-06-19 11:23 ` Steffen Rumler
@ 2002-06-19 11:31 ` Steffen Rumler
0 siblings, 0 replies; 3+ messages in thread
From: Steffen Rumler @ 2002-06-19 11:31 UTC (permalink / raw)
To: Ludszuweit, Axel, linuxppc-embedded
Sorry, the
dmi = dmi->next; !!!
was missing:
static void
set_multicast_list(struct net_device *dev)
{
struct fcc_enet_private *cep;
struct dev_mc_list *dmi;
u_char *mcptr, *tdptr;
volatile fcc_enet_t *ep;
int i, j;
cep = (struct fcc_enet_private *)dev->priv;
/* Get pointer to FCC area in parameter RAM.
*/
ep = (fcc_enet_t *)dev->base_addr;
if (dev->flags&IFF_PROMISC) {
/* Log any net taps. */
printk("%s: Promiscuous mode enabled.\n", dev->name);
cep->fccp->fcc_fpsmr |= FCC_PSMR_PRO;
} else {
cep->fccp->fcc_fpsmr &= ~FCC_PSMR_PRO;
if (dev->flags & IFF_ALLMULTI) {
/* Catch all multicast addresses, so set the
* filter to all 1's.
*/
ep->fen_gaddrh = 0xffffffff;
ep->fen_gaddrl = 0xffffffff;
}
else {
/* Clear filter and add the addresses in the list.
*/
ep->fen_gaddrh = 0;
ep->fen_gaddrl = 0;
dmi = dev->mc_list;
for (i=0; i<dev->mc_count; i++) {
/* Only support group multicast for now.
*/
if (!(dmi->dmi_addr[0] & 1))
continue;
/* The address in dmi_addr is LSB first,
* and taddr is MSB first. We have to
* copy bytes MSB first from dmi_addr.
*/
mcptr = (u_char *)dmi->dmi_addr + 5;
tdptr = (u_char *)&ep->fen_taddrh;
for (j=0; j<6; j++)
*tdptr++ = *mcptr--;
/* Ask CPM to run CRC and set bit in
* filter mask.
*/
#ifdef CONFIG_MCU
run_cpcr_cmd(cep->fip->fc_cpmpage,
cep->fip->fc_cpmblock,
0x0c,
CPM_CR_SET_GADDR);
#else /* CONFIG_MCU */
cpmp->cp_cpcr = mk_cr_cmd(cep->fip->fc_cpmpage,
cep->fip->fc_cpmblock, 0x0c,
CPM_CR_SET_GADDR) | CPM_CR_FLG;
udelay(10);
while (cpmp->cp_cpcr & CPM_CR_FLG);
#endif /* CONFIG_MCU */
dmi = dmi->next; /* S.R. switch to the next list entry */
}
}
}
}
--
--------------------------------------------------------------
Steffen Rumler
ICN ON PNE SB 4
Siemens AG
Hofmannstr. 51 Email: Steffen.Rumler@icn.siemens.de
D-81359 Munich Phone: +49 89 722-44061
Germany Fax : +49 89 722-36703
--------------------------------------------------------------
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-06-19 11:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-06-19 10:42 set_multicast_list function of ppc enet driver Ludszuweit, Axel
2002-06-19 11:23 ` Steffen Rumler
2002-06-19 11:31 ` Steffen Rumler
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).