Re: [PATCH] staging: vt6656: removed custom definitions of Ethernet packet types

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2010-08-03 at 22:08 -0300, Andres More wrote:
> Removed some unused definitions of Ethernet packet types, also replaced two
> of them with their in-kernel counterparts from include/linux/if_ether.h

Hi Andres.

> --- a/drivers/staging/vt6656/dpc.c
> +++ b/drivers/staging/vt6656/dpc.c
> @@ -200,8 +200,10 @@ s_vProcessRxMACHeader (
>      } else if (!compare_ether_addr(pbyRxBuffer, &pDevice->abySNAP_RFC1042[0])) {
>          cbHeaderSize += 6;
>          pwType = (PWORD) (pbyRxBufferAddr + cbHeaderSize);
> -        if ((*pwType!= TYPE_PKT_IPX) && (*pwType != cpu_to_le16(0xF380))) {
> -        }
> +
> +	if ((*pwType != ETH_P_IPX) && (*pwType != cpu_to_le16(0xF380))) {
> +		;
> +	}


This change is broken.
TYPE_PKT_IPX is one of 2 #defines based on BE/LE use.

And perhaps this is more readable and correct as:

	if ((*pwType == cpu_to_le16(ETH_P_IPX)) ||
	    (*pwType == cpu_to_le16(0xF380))) {
>              cbHeaderSize -= 8;
>              pwType = (PWORD) (pbyRxBufferAddr + cbHeaderSize);

[]

> +    if (pDevice->sTxEthHeader.wType == ETH_P_PAE) {
> +	/* 802.1x OR eapol-key challenge frame transfer */
> +	if (((Protocol_Version == 1) || (Protocol_Version == 2))
> +	    && (Packet_Type == 3)) {

Linux source generally has the logical test as end of line

	if (((Protocol_Version == 1) || (Protocol_Version == 2)) &&
	    (Packet_Type == 3)) {


_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux