Commit bd37b7fd authored by Pekka Enberg's avatar Pekka Enberg Committed by Greg Kroah-Hartman

Staging: 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.
Acked-by: default avatarHarvey Harrison <harvey.harrison@gmail.com>
Acked-by: default avatarPavel Machek <pavel@suse.cz>
Signed-off-by: default avatarPekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 64328c87
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
// Common function definition // Common function definition
//================================================================================================== //==================================================================================================
#define DEBUG_ENABLED #define DEBUG_ENABLED
#define ETH_LENGTH_OF_ADDRESS 6
#ifdef DEBUG_ENABLED #ifdef DEBUG_ENABLED
#define WBDEBUG( _M ) printk _M #define WBDEBUG( _M ) printk _M
#else #else
......
...@@ -948,14 +948,13 @@ Uxx_ReadEthernetAddress( phw_data_t pHwData ) ...@@ -948,14 +948,13 @@ Uxx_ReadEthernetAddress( phw_data_t pHwData )
// Return Value: // Return Value:
// None. // None.
//============================================================================================================== //==============================================================================================================
void CardGetMulticastBit( u8 Address[ETH_LENGTH_OF_ADDRESS], void CardGetMulticastBit( u8 Address[ETH_ALEN], u8 *Byte, u8 *Value )
u8 *Byte, u8 *Value )
{ {
u32 Crc; u32 Crc;
u32 BitNumber; u32 BitNumber;
// First compute the CRC. // 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 // 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 //At first we should do right shift 25bits, and read 7bits by using '&', 2^7=128
......
...@@ -599,7 +599,7 @@ unsigned char Wb35Reg_initial(phw_data_t pHwData) ...@@ -599,7 +599,7 @@ unsigned char Wb35Reg_initial(phw_data_t pHwData)
Wb35Reg_ReadSync( pHwData, 0x03b4, &Region_ScanInterval ); Wb35Reg_ReadSync( pHwData, 0x03b4, &Region_ScanInterval );
// Update Ethernet address // Update Ethernet address
memcpy( pHwData->CurrentMacAddress, pHwData->PermanentMacAddress, ETH_LENGTH_OF_ADDRESS ); memcpy( pHwData->CurrentMacAddress, pHwData->PermanentMacAddress, ETH_ALEN );
// Update software variable // Update software variable
pHwData->SoftwareSet = (u16)(SoftwareSet & 0xffff); pHwData->SoftwareSet = (u16)(SoftwareSet & 0xffff);
......
...@@ -8,7 +8,7 @@ void hal_set_ethernet_address( phw_data_t pHwData, u8 *current_address ) ...@@ -8,7 +8,7 @@ void hal_set_ethernet_address( phw_data_t pHwData, u8 *current_address )
if( pHwData->SurpriseRemove ) return; 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[0]= cpu_to_le32( *(u32 *)pHwData->CurrentMacAddress );
ltmp[1]= cpu_to_le32( *(u32 *)(pHwData->CurrentMacAddress + 4) ) & 0xffff; ltmp[1]= cpu_to_le32( *(u32 *)(pHwData->CurrentMacAddress + 4) ) & 0xffff;
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#define __WINBOND_WBHAL_S_H #define __WINBOND_WBHAL_S_H
#include <linux/types.h> #include <linux/types.h>
#include <linux/if_ether.h> /* for ETH_ALEN */
#include "common.h" #include "common.h"
...@@ -427,7 +428,6 @@ typedef struct _TXVGA_FOR_50 { ...@@ -427,7 +428,6 @@ typedef struct _TXVGA_FOR_50 {
#include "wb35tx_s.h" #include "wb35tx_s.h"
#include "wb35rx_s.h" #include "wb35rx_s.h"
// For Hal using ================================================================== // For Hal using ==================================================================
typedef struct _HW_DATA_T typedef struct _HW_DATA_T
{ {
...@@ -452,8 +452,8 @@ typedef struct _HW_DATA_T ...@@ -452,8 +452,8 @@ typedef struct _HW_DATA_T
//=============================================== //===============================================
// Definition for MAC address // 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 PermanentMacAddress[ETH_ALEN + 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 CurrentMacAddress[ETH_ALEN + 2]; // The Enthernet addr that are in used. + 2 to 8-byte alignment
//===================================================================== //=====================================================================
// Definition for 802.11 // Definition for 802.11
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment