linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][EMAC] allow rx of the maximum sized VLAN tagged packets
@ 2004-12-07 17:52 Matt Porter
  2004-12-13 13:08 ` Andriy Korud
  0 siblings, 1 reply; 3+ messages in thread
From: Matt Porter @ 2004-12-07 17:52 UTC (permalink / raw)
  To: jgarzik; +Cc: linuxppc-embedded

Patch enables EMAC to receive maximum sized VLAN tagged packets. 

Signed-off-by: Eugene Surovegin <ebs@ebshome.net>
Signed-off-by: Matt Porter <mporter@kernel.crashing.org>

===== drivers/net/ibm_emac/ibm_emac.h 1.1 vs edited =====
--- 1.1/drivers/net/ibm_emac/ibm_emac.h	2004-05-22 10:13:08 -07:00
+++ edited/drivers/net/ibm_emac/ibm_emac.h	2004-08-24 12:19:41 -07:00
@@ -98,7 +98,7 @@
 #endif				/* CONFIG_IBM_EMAC4 */
 #define EMAC_M1_BASE			(EMAC_M1_TX_FIFO_2K | \
 					EMAC_M1_APP | \
-					EMAC_M1_TR)
+					EMAC_M1_TR | EMAC_M1_VLE)
 
 /* Transmit Mode Register 0 */
 #define EMAC_TMR0_GNP0			0x80000000
===== drivers/net/ibm_emac/ibm_emac_core.c 1.2 vs edited =====
--- 1.2/drivers/net/ibm_emac/ibm_emac_core.c	2004-06-04 08:50:36 -07:00
+++ edited/drivers/net/ibm_emac/ibm_emac_core.c	2004-08-24 12:18:27 -07:00
@@ -1335,6 +1335,9 @@
 
 	/* set frame gap */
 	out_be32(&emacp->em0ipgvr, CONFIG_IBM_EMAC_FGAP);
+	
+	/* set VLAN Tag Protocol Identifier */
+	out_be32(&emacp->em0vtpid, 0x8100);
 
 	/* Init ring buffers */
 	emac_init_rings(fep->ndev);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][EMAC] allow rx of the maximum sized VLAN tagged packets
  2004-12-07 17:52 [PATCH][EMAC] allow rx of the maximum sized VLAN tagged packets Matt Porter
@ 2004-12-13 13:08 ` Andriy Korud
  2004-12-13 18:02   ` Eugene Surovegin
  0 siblings, 1 reply; 3+ messages in thread
From: Andriy Korud @ 2004-12-13 13:08 UTC (permalink / raw)
  To: Matt Porter; +Cc: jgarzik, linuxppc-embedded

Hi, 
as I know from documentation and IBM's support when you program VTPID
register, EMAC will receive only frames with programmed ID. Other frames
will be received only if they do not exceed 1518 bytes.
Can anybody please comment this?

Thanks in advance,

--

Andriy Korud


On Tue, 2004-12-07 at 10:52 -0700, Matt Porter wrote:
> Patch enables EMAC to receive maximum sized VLAN tagged packets. 
> 
> Signed-off-by: Eugene Surovegin <ebs@ebshome.net>
> Signed-off-by: Matt Porter <mporter@kernel.crashing.org>
> 
> ===== drivers/net/ibm_emac/ibm_emac.h 1.1 vs edited =====
> --- 1.1/drivers/net/ibm_emac/ibm_emac.h	2004-05-22 10:13:08 -07:00
> +++ edited/drivers/net/ibm_emac/ibm_emac.h	2004-08-24 12:19:41 -07:00
> @@ -98,7 +98,7 @@
>  #endif				/* CONFIG_IBM_EMAC4 */
>  #define EMAC_M1_BASE			(EMAC_M1_TX_FIFO_2K | \
>  					EMAC_M1_APP | \
> -					EMAC_M1_TR)
> +					EMAC_M1_TR | EMAC_M1_VLE)
>  
>  /* Transmit Mode Register 0 */
>  #define EMAC_TMR0_GNP0			0x80000000
> ===== drivers/net/ibm_emac/ibm_emac_core.c 1.2 vs edited =====
> --- 1.2/drivers/net/ibm_emac/ibm_emac_core.c	2004-06-04 08:50:36 -07:00
> +++ edited/drivers/net/ibm_emac/ibm_emac_core.c	2004-08-24 12:18:27 -07:00
> @@ -1335,6 +1335,9 @@
>  
>  	/* set frame gap */
>  	out_be32(&emacp->em0ipgvr, CONFIG_IBM_EMAC_FGAP);
> +	
> +	/* set VLAN Tag Protocol Identifier */
> +	out_be32(&emacp->em0vtpid, 0x8100);
>  
>  	/* Init ring buffers */
>  	emac_init_rings(fep->ndev);
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][EMAC] allow rx of the maximum sized VLAN tagged packets
  2004-12-13 13:08 ` Andriy Korud
@ 2004-12-13 18:02   ` Eugene Surovegin
  0 siblings, 0 replies; 3+ messages in thread
From: Eugene Surovegin @ 2004-12-13 18:02 UTC (permalink / raw)
  To: Andriy Korud; +Cc: jgarzik, linuxppc-embedded

On Mon, Dec 13, 2004 at 02:08:22PM +0100, Andriy Korud wrote:
> as I know from documentation and IBM's support when you program VTPID
> register, EMAC will receive only frames with programmed ID. Other frames
> will be received only if they do not exceed 1518 bytes.
> Can anybody please comment this?

I'm not sure I understand your question.

EMAC can process 1518-sized packets without any problems (1500 + 12 + 
2 + 4) even without this patch. These are normal (non-VLAN tagged 
packets).

With my patch EMAC will be able to receive 1522 sized frames which 
are VLAN-tagged with _any_ VLAN tag. Note VTPID contains L2 protocol 
id, _not_ VLAN/priority field itself. If frame is bigger than 1518 
but doesn't have 0x8100 right after the source MAC address, "Packet 
Too Long" error will be generated. 

Also, 440GX has an option to process jumbo frames, but this is 
completely different story.

--
Eugene

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-12-13 18:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-07 17:52 [PATCH][EMAC] allow rx of the maximum sized VLAN tagged packets Matt Porter
2004-12-13 13:08 ` Andriy Korud
2004-12-13 18:02   ` Eugene Surovegin

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).