* [PATCH 1/3] w35und: Move ETH_LENGTH_OF_ADDRESS to wbhal_s.h
@ 2009-01-08 9:30 Pekka J Enberg
2009-01-08 9:46 ` Harvey Harrison
0 siblings, 1 reply; 5+ messages in thread
From: Pekka J Enberg @ 2009-01-08 9:30 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Pavel Machek, linux-kernel
From: Pekka Enberg <penberg@cs.helsinki.fi>
The common.h header file is a dumping ground for miscellaneous crap. In order
to get rid of it, move the ETH_LENGHT_OF_ADDRESS macro to wbhal_s.h where it's
actually being used.
Cc: Pavel Machek <pavel@suse.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
---
drivers/staging/winbond/common.h | 1 -
drivers/staging/winbond/wbhal_s.h | 1 +
2 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/winbond/common.h b/drivers/staging/winbond/common.h
index c4d9604..61ccc86 100644
--- a/drivers/staging/winbond/common.h
+++ b/drivers/staging/winbond/common.h
@@ -16,7 +16,6 @@
// Common function definition
//==================================================================================================
#define DEBUG_ENABLED
-#define ETH_LENGTH_OF_ADDRESS 6
#ifdef DEBUG_ENABLED
#define WBDEBUG( _M ) printk _M
#else
diff --git a/drivers/staging/winbond/wbhal_s.h b/drivers/staging/winbond/wbhal_s.h
index 276d2b1..513babb 100644
--- a/drivers/staging/winbond/wbhal_s.h
+++ b/drivers/staging/winbond/wbhal_s.h
@@ -427,6 +427,7 @@ typedef struct _TXVGA_FOR_50 {
#include "wb35tx_s.h"
#include "wb35rx_s.h"
+#define ETH_LENGTH_OF_ADDRESS 6
// For Hal using ==================================================================
typedef struct _HW_DATA_T
--
1.5.4.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/3] w35und: Move ETH_LENGTH_OF_ADDRESS to wbhal_s.h
2009-01-08 9:30 [PATCH 1/3] w35und: Move ETH_LENGTH_OF_ADDRESS to wbhal_s.h Pekka J Enberg
@ 2009-01-08 9:46 ` Harvey Harrison
2009-01-08 9:56 ` Pekka Enberg
0 siblings, 1 reply; 5+ messages in thread
From: Harvey Harrison @ 2009-01-08 9:46 UTC (permalink / raw)
To: Pekka J Enberg; +Cc: Greg Kroah-Hartman, Pavel Machek, linux-kernel
On Thu, 2009-01-08 at 11:30 +0200, Pekka J Enberg wrote:
> From: Pekka Enberg <penberg@cs.helsinki.fi>
>
> +#define ETH_LENGTH_OF_ADDRESS 6
Or just use ETH_ALEN like the rest of the kernel and drop this guy.
Harvey
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/3] w35und: Move ETH_LENGTH_OF_ADDRESS to wbhal_s.h
2009-01-08 9:46 ` Harvey Harrison
@ 2009-01-08 9:56 ` Pekka Enberg
2009-01-08 10:08 ` Pavel Machek
2009-01-08 10:13 ` Harvey Harrison
0 siblings, 2 replies; 5+ messages in thread
From: Pekka Enberg @ 2009-01-08 9:56 UTC (permalink / raw)
To: Harvey Harrison; +Cc: Greg Kroah-Hartman, Pavel Machek, linux-kernel
On Thu, 2009-01-08 at 01:46 -0800, Harvey Harrison wrote:
> On Thu, 2009-01-08 at 11:30 +0200, Pekka J Enberg wrote:
> > From: Pekka Enberg <penberg@cs.helsinki.fi>
> >
> > +#define ETH_LENGTH_OF_ADDRESS 6
>
> Or just use ETH_ALEN like the rest of the kernel and drop this guy.
Even better, thanks Harvey! Greg, please use this one instead. The rest
of the series is unaffected by the changes in this patch.
>From c849ed5b5e68953a72f8dc43066513f118822f94 Mon Sep 17 00:00:00 2001
From: Pekka Enberg <penberg@cs.helsinki.fi>
Date: Thu, 8 Jan 2009 11:10:06 +0200
Subject: [PATCH] w35und: convert code to use ETH_ALEN
As suggested by Harvey Harrison, convert driver to use ETH_ALEN and kill a
private macro from common.h that is used for the same thing.
Cc: Harvey Harrison <harvey.harrison@gmail.com>
Cc: Pavel Machek <pavel@suse.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
---
drivers/staging/winbond/common.h | 1 -
drivers/staging/winbond/reg.c | 5 ++---
drivers/staging/winbond/wb35reg.c | 2 +-
drivers/staging/winbond/wbhal.c | 2 +-
drivers/staging/winbond/wbhal_s.h | 6 +++---
5 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/winbond/common.h b/drivers/staging/winbond/common.h
index c4d9604..61ccc86 100644
--- a/drivers/staging/winbond/common.h
+++ b/drivers/staging/winbond/common.h
@@ -16,7 +16,6 @@
// Common function definition
//==================================================================================================
#define DEBUG_ENABLED
-#define ETH_LENGTH_OF_ADDRESS 6
#ifdef DEBUG_ENABLED
#define WBDEBUG( _M ) printk _M
#else
diff --git a/drivers/staging/winbond/reg.c b/drivers/staging/winbond/reg.c
index c365c5d..ed08e00 100644
--- a/drivers/staging/winbond/reg.c
+++ b/drivers/staging/winbond/reg.c
@@ -948,14 +948,13 @@ Uxx_ReadEthernetAddress( phw_data_t pHwData )
// Return Value:
// None.
//==============================================================================================================
-void CardGetMulticastBit( u8 Address[ETH_LENGTH_OF_ADDRESS],
- u8 *Byte, u8 *Value )
+void CardGetMulticastBit( u8 Address[ETH_ALEN], u8 *Byte, u8 *Value )
{
u32 Crc;
u32 BitNumber;
// First compute the CRC.
- Crc = CardComputeCrc(Address, ETH_LENGTH_OF_ADDRESS);
+ Crc = CardComputeCrc(Address, ETH_ALEN);
// The computed CRC is bit0~31 from left to right
//At first we should do right shift 25bits, and read 7bits by using '&', 2^7=128
diff --git a/drivers/staging/winbond/wb35reg.c b/drivers/staging/winbond/wb35reg.c
index c74b3fd..87c2c43 100644
--- a/drivers/staging/winbond/wb35reg.c
+++ b/drivers/staging/winbond/wb35reg.c
@@ -599,7 +599,7 @@ unsigned char Wb35Reg_initial(phw_data_t pHwData)
Wb35Reg_ReadSync( pHwData, 0x03b4, &Region_ScanInterval );
// Update Ethernet address
- memcpy( pHwData->CurrentMacAddress, pHwData->PermanentMacAddress, ETH_LENGTH_OF_ADDRESS );
+ memcpy( pHwData->CurrentMacAddress, pHwData->PermanentMacAddress, ETH_ALEN );
// Update software variable
pHwData->SoftwareSet = (u16)(SoftwareSet & 0xffff);
diff --git a/drivers/staging/winbond/wbhal.c b/drivers/staging/winbond/wbhal.c
index d7bbb9a..a2cc077 100644
--- a/drivers/staging/winbond/wbhal.c
+++ b/drivers/staging/winbond/wbhal.c
@@ -8,7 +8,7 @@ void hal_set_ethernet_address( phw_data_t pHwData, u8 *current_address )
if( pHwData->SurpriseRemove ) return;
- memcpy( pHwData->CurrentMacAddress, current_address, ETH_LENGTH_OF_ADDRESS );
+ memcpy( pHwData->CurrentMacAddress, current_address, ETH_ALEN );
ltmp[0]= cpu_to_le32( *(u32 *)pHwData->CurrentMacAddress );
ltmp[1]= cpu_to_le32( *(u32 *)(pHwData->CurrentMacAddress + 4) ) & 0xffff;
diff --git a/drivers/staging/winbond/wbhal_s.h b/drivers/staging/winbond/wbhal_s.h
index 276d2b1..9353ac2 100644
--- a/drivers/staging/winbond/wbhal_s.h
+++ b/drivers/staging/winbond/wbhal_s.h
@@ -2,6 +2,7 @@
#define __WINBOND_WBHAL_S_H
#include <linux/types.h>
+#include <linux/if_ether.h> /* for ETH_ALEN */
#include "common.h"
@@ -427,7 +428,6 @@ typedef struct _TXVGA_FOR_50 {
#include "wb35tx_s.h"
#include "wb35rx_s.h"
-
// For Hal using ==================================================================
typedef struct _HW_DATA_T
{
@@ -452,8 +452,8 @@ typedef struct _HW_DATA_T
//===============================================
// Definition for MAC address
//===============================================
- u8 PermanentMacAddress[ETH_LENGTH_OF_ADDRESS + 2]; // The Enthernet addr that are stored in EEPROM. + 2 to 8-byte alignment
- u8 CurrentMacAddress[ETH_LENGTH_OF_ADDRESS + 2]; // The Enthernet addr that are in used. + 2 to 8-byte alignment
+ u8 PermanentMacAddress[ETH_ALEN + 2]; // The Enthernet addr that are stored in EEPROM. + 2 to 8-byte alignment
+ u8 CurrentMacAddress[ETH_ALEN + 2]; // The Enthernet addr that are in used. + 2 to 8-byte alignment
//=====================================================================
// Definition for 802.11
--
1.5.4.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/3] w35und: Move ETH_LENGTH_OF_ADDRESS to wbhal_s.h
2009-01-08 9:56 ` Pekka Enberg
@ 2009-01-08 10:08 ` Pavel Machek
2009-01-08 10:13 ` Harvey Harrison
1 sibling, 0 replies; 5+ messages in thread
From: Pavel Machek @ 2009-01-08 10:08 UTC (permalink / raw)
To: Pekka Enberg; +Cc: Harvey Harrison, Greg Kroah-Hartman, linux-kernel
On Thu 2009-01-08 11:56:53, Pekka Enberg wrote:
> On Thu, 2009-01-08 at 01:46 -0800, Harvey Harrison wrote:
> > On Thu, 2009-01-08 at 11:30 +0200, Pekka J Enberg wrote:
> > > From: Pekka Enberg <penberg@cs.helsinki.fi>
> > >
> > > +#define ETH_LENGTH_OF_ADDRESS 6
> >
> > Or just use ETH_ALEN like the rest of the kernel and drop this guy.
>
> Even better, thanks Harvey! Greg, please use this one instead. The rest
> of the series is unaffected by the changes in this patch.
>
> >From c849ed5b5e68953a72f8dc43066513f118822f94 Mon Sep 17 00:00:00 2001
> From: Pekka Enberg <penberg@cs.helsinki.fi>
> Date: Thu, 8 Jan 2009 11:10:06 +0200
> Subject: [PATCH] w35und: convert code to use ETH_ALEN
>
> As suggested by Harvey Harrison, convert driver to use ETH_ALEN and kill a
> private macro from common.h that is used for the same thing.
>
> Cc: Harvey Harrison <harvey.harrison@gmail.com>
> Cc: Pavel Machek <pavel@suse.cz>
> Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
ACK.
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/3] w35und: Move ETH_LENGTH_OF_ADDRESS to wbhal_s.h
2009-01-08 9:56 ` Pekka Enberg
2009-01-08 10:08 ` Pavel Machek
@ 2009-01-08 10:13 ` Harvey Harrison
1 sibling, 0 replies; 5+ messages in thread
From: Harvey Harrison @ 2009-01-08 10:13 UTC (permalink / raw)
To: Pekka Enberg; +Cc: Greg Kroah-Hartman, Pavel Machek, linux-kernel
On Thu, 2009-01-08 at 11:56 +0200, Pekka Enberg wrote:
> On Thu, 2009-01-08 at 01:46 -0800, Harvey Harrison wrote:
> > On Thu, 2009-01-08 at 11:30 +0200, Pekka J Enberg wrote:
> > > From: Pekka Enberg <penberg@cs.helsinki.fi>
> > >
> > > +#define ETH_LENGTH_OF_ADDRESS 6
> >
> > Or just use ETH_ALEN like the rest of the kernel and drop this guy.
>
> Even better, thanks Harvey! Greg, please use this one instead. The rest
> of the series is unaffected by the changes in this patch.
>
> >From c849ed5b5e68953a72f8dc43066513f118822f94 Mon Sep 17 00:00:00 2001
> From: Pekka Enberg <penberg@cs.helsinki.fi>
> Date: Thu, 8 Jan 2009 11:10:06 +0200
> Subject: [PATCH] w35und: convert code to use ETH_ALEN
>
> As suggested by Harvey Harrison, convert driver to use ETH_ALEN and kill a
> private macro from common.h that is used for the same thing.
Untested, but obviously ACK the approach :-)
Harvey
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-01-08 10:13 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-08 9:30 [PATCH 1/3] w35und: Move ETH_LENGTH_OF_ADDRESS to wbhal_s.h Pekka J Enberg
2009-01-08 9:46 ` Harvey Harrison
2009-01-08 9:56 ` Pekka Enberg
2009-01-08 10:08 ` Pavel Machek
2009-01-08 10:13 ` Harvey Harrison
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.