' ########################################################################################
' Microsoft Windows
' File: l2cmn.inc
' Contents: Definitions and data strcutures for common layer 2
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_l2cmn_PBI)
#DEFINE PBX_l2cmn_PBI
%EQUATE `L2CMN_INC = 1
'// Profile name max length, in characters
%EQUATE `L2_PROFILE_MAX_NAME_LENGTH = 256
'// If a notification needs to be private that is only consumed by internal components
'// then it should be part of l2cmnpriv.h
'// the types of notification
'// This signifies what kind of notification is to be passed on , the
'// 0X0000FFFF signifies all public notifications , so all notfications that need to be public
'// should be in this range and have a single bit set as these flags can be combined.
%EQUATE `L2_NOTIFICATION_SOURCE_NONE = 0
%EQUATE `L2_NOTIFICATION_SOURCE_DOT3_AUTO_CONFIG = &H00000001
%EQUATE `L2_NOTIFICATION_SOURCE_SECURITY = &H00000002
%EQUATE `L2_NOTIFICATION_SOURCE_ONEX = &H00000004
%EQUATE `L2_NOTIFICATION_SOURCE_WLAN_ACM = &H00000008
%EQUATE `L2_NOTIFICATION_SOURCE_WLAN_MSM = &H00000010
%EQUATE `L2_NOTIFICATION_SOURCE_WLAN_SECURITY = &H00000020
%EQUATE `L2_NOTIFICATION_SOURCE_WLAN_IHV = &H00000040
%EQUATE `L2_NOTIFICATION_SOURCE_WLAN_HNWK = &H00000080
%EQUATE `L2_NOTIFICATION_SOURCE_ALL = &H0000FFFF
%EQUATE `L2_NOTIFICATION_CODE_PUBLIC_BEGIN = &H00000000
%EQUATE `L2_NOTIFICATION_CODE_GROUP_SIZE = &H00001000
%EQUATE `L2_NOTIFICATION_CODE_V2_BEGIN = (%L2_NOTIFICATION_CODE_PUBLIC_BEGIN+%L2_NOTIFICATION_CODE_GROUP_SIZE)
'// L2 reason code
'// reason code bases
%EQUATE `L2_REASON_CODE_GROUP_SIZE = &H10000
%EQUATE `L2_REASON_CODE_GEN_BASE = &H10000
%EQUATE `L2_REASON_CODE_DOT11_AC_BASE = (%L2_REASON_CODE_GEN_BASE+%L2_REASON_CODE_GROUP_SIZE)
%EQUATE `L2_REASON_CODE_DOT11_MSM_BASE = (%L2_REASON_CODE_DOT11_AC_BASE+%L2_REASON_CODE_GROUP_SIZE)
%EQUATE `L2_REASON_CODE_DOT11_SECURITY_BASE = (%L2_REASON_CODE_DOT11_MSM_BASE+%L2_REASON_CODE_GROUP_SIZE)
%EQUATE `L2_REASON_CODE_ONEX_BASE = (%L2_REASON_CODE_DOT11_SECURITY_BASE+%L2_REASON_CODE_GROUP_SIZE)
%EQUATE `L2_REASON_CODE_DOT3_AC_BASE = (%L2_REASON_CODE_ONEX_BASE+%L2_REASON_CODE_GROUP_SIZE)
%EQUATE `L2_REASON_CODE_DOT3_MSM_BASE = (%L2_REASON_CODE_DOT3_AC_BASE+%L2_REASON_CODE_GROUP_SIZE)
%EQUATE `L2_REASON_CODE_PROFILE_BASE = (%L2_REASON_CODE_DOT3_MSM_BASE+%L2_REASON_CODE_GROUP_SIZE)
%EQUATE `L2_REASON_CODE_IHV_BASE = (%L2_REASON_CODE_PROFILE_BASE+%L2_REASON_CODE_GROUP_SIZE)
%EQUATE `L2_REASON_CODE_WIMAX_BASE = (%L2_REASON_CODE_IHV_BASE+%L2_REASON_CODE_GROUP_SIZE)
'// the common reason codes
%EQUATE `L2_REASON_CODE_SUCCESS = 0
'// general reason code
%EQUATE `L2_REASON_CODE_UNKNOWN = (%L2_REASON_CODE_GEN_BASE+1)
'// common profile section missing
%EQUATE `L2_REASON_CODE_PROFILE_MISSING = &H00000001
'// This structure is the notification structure which needs to be filled in by each component
'// The interface guid is filled in only by the AC
'// The NotificationSource signifies the type above
'// and NotificationCode is one of the enum values
' // Size = 32 bytes
TYPE L2_NOTIFICATION_DATA DWORD
 NotificationSource AS DWORD
 NotificationCode AS DWORD
 InterfaceGuid AS GUID ' GUID
 dwDataSize AS DWORD
#IF %DEF(%USEPBDECL)
 pData AS BYTE PTR
#ELSE
 pData AS DWORD
#ENDIF
END TYPE
#ENDIF
