Staging: hv: use existing Ethernet header size
Use ETH_ALEN to indicate that MAC address is Ethernet. Also use Linux printk format for mac addresses. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Acked-by: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
450d7a4b7a
commit
9f8bd8bacf
2 changed files with 7 additions and 17 deletions
|
@ -27,9 +27,6 @@
|
||||||
|
|
||||||
#include "VmbusApi.h"
|
#include "VmbusApi.h"
|
||||||
|
|
||||||
/* Defines */
|
|
||||||
#define HW_MACADDR_LEN 6
|
|
||||||
|
|
||||||
/* Fwd declaration */
|
/* Fwd declaration */
|
||||||
struct hv_netvsc_packet;
|
struct hv_netvsc_packet;
|
||||||
|
|
||||||
|
@ -92,9 +89,6 @@ struct netvsc_driver {
|
||||||
u32 RingBufferSize;
|
u32 RingBufferSize;
|
||||||
u32 RequestExtSize;
|
u32 RequestExtSize;
|
||||||
|
|
||||||
/* Additional num of page buffers to allocate */
|
|
||||||
u32 AdditionalRequestPageBufferCount;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is set by the caller to allow us to callback when we
|
* This is set by the caller to allow us to callback when we
|
||||||
* receive a packet from the "wire"
|
* receive a packet from the "wire"
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
#include <linux/highmem.h>
|
#include <linux/highmem.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/io.h>
|
#include <linux/io.h>
|
||||||
|
#include <linux/if_ether.h>
|
||||||
|
|
||||||
#include "osd.h"
|
#include "osd.h"
|
||||||
#include "logging.h"
|
#include "logging.h"
|
||||||
#include "NetVscApi.h"
|
#include "NetVscApi.h"
|
||||||
|
@ -50,7 +52,7 @@ struct rndis_device {
|
||||||
spinlock_t request_lock;
|
spinlock_t request_lock;
|
||||||
struct list_head RequestList;
|
struct list_head RequestList;
|
||||||
|
|
||||||
unsigned char HwMacAddr[HW_MACADDR_LEN];
|
unsigned char HwMacAddr[ETH_ALEN];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct rndis_request {
|
struct rndis_request {
|
||||||
|
@ -538,7 +540,7 @@ Cleanup:
|
||||||
|
|
||||||
static int RndisFilterQueryDeviceMac(struct rndis_device *Device)
|
static int RndisFilterQueryDeviceMac(struct rndis_device *Device)
|
||||||
{
|
{
|
||||||
u32 size = HW_MACADDR_LEN;
|
u32 size = ETH_ALEN;
|
||||||
|
|
||||||
return RndisFilterQueryDevice(Device,
|
return RndisFilterQueryDevice(Device,
|
||||||
RNDIS_OID_802_3_PERMANENT_ADDRESS,
|
RNDIS_OID_802_3_PERMANENT_ADDRESS,
|
||||||
|
@ -833,16 +835,10 @@ static int RndisFilterOnDeviceAdd(struct hv_device *Device,
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINT_INFO(NETVSC, "Device 0x%p mac addr %02x%02x%02x%02x%02x%02x",
|
DPRINT_INFO(NETVSC, "Device 0x%p mac addr %pM",
|
||||||
rndisDevice,
|
rndisDevice, rndisDevice->HwMacAddr);
|
||||||
rndisDevice->HwMacAddr[0],
|
|
||||||
rndisDevice->HwMacAddr[1],
|
|
||||||
rndisDevice->HwMacAddr[2],
|
|
||||||
rndisDevice->HwMacAddr[3],
|
|
||||||
rndisDevice->HwMacAddr[4],
|
|
||||||
rndisDevice->HwMacAddr[5]);
|
|
||||||
|
|
||||||
memcpy(deviceInfo->MacAddr, rndisDevice->HwMacAddr, HW_MACADDR_LEN);
|
memcpy(deviceInfo->MacAddr, rndisDevice->HwMacAddr, ETH_ALEN);
|
||||||
|
|
||||||
RndisFilterQueryDeviceLinkStatus(rndisDevice);
|
RndisFilterQueryDeviceLinkStatus(rndisDevice);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue