M7350v1_en_gpl

This commit is contained in:
T
2024-09-09 08:52:07 +00:00
commit f9cc65cfda
65988 changed files with 26357421 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,45 @@
/*
* BT-AMP (BlueTooth Alternate Mac and Phy) 802.11 PAL (Protocol Adaptation Layer)
*
* Copyright (C) 1999-2012, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* under the terms of the GNU General Public License version 2 (the "GPL"),
* available at http://www.broadcom.com/licenses/GPLv2.php, with the
* following added to such license:
*
* As a special exception, the copyright holders of this software give you
* permission to link this software with independent modules, and to copy and
* distribute the resulting executable under terms of your choice, provided that
* you also meet, for each linked independent module, the terms and conditions of
* the license of that module. An independent module is a module which is not
* derived from this software. The special exception does not apply to any
* modifications of the software.
*
* Notwithstanding the above, under no circumstances may you combine this
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
* $Id: 802.11_bta.h 294267 2011-11-04 23:41:52Z $
*/
#ifndef _802_11_BTA_H_
#define _802_11_BTA_H_
#define BT_SIG_SNAP_MPROT "\xAA\xAA\x03\x00\x19\x58"
/* BT-AMP 802.11 PAL Protocols */
#define BTA_PROT_L2CAP 1
#define BTA_PROT_ACTIVITY_REPORT 2
#define BTA_PROT_SECURITY 3
#define BTA_PROT_LINK_SUPERVISION_REQUEST 4
#define BTA_PROT_LINK_SUPERVISION_REPLY 5
/* BT-AMP 802.11 PAL AMP_ASSOC Type IDs */
#define BTA_TYPE_ID_MAC_ADDRESS 1
#define BTA_TYPE_ID_PREFERRED_CHANNELS 2
#define BTA_TYPE_ID_CONNECTED_CHANNELS 3
#define BTA_TYPE_ID_CAPABILITIES 4
#define BTA_TYPE_ID_VERSION 5
#endif /* _802_11_bta_h_ */

View File

@@ -0,0 +1,131 @@
/*
* 802.11e protocol header file
*
* Copyright (C) 1999-2012, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* under the terms of the GNU General Public License version 2 (the "GPL"),
* available at http://www.broadcom.com/licenses/GPLv2.php, with the
* following added to such license:
*
* As a special exception, the copyright holders of this software give you
* permission to link this software with independent modules, and to copy and
* distribute the resulting executable under terms of your choice, provided that
* you also meet, for each linked independent module, the terms and conditions of
* the license of that module. An independent module is a module which is not
* derived from this software. The special exception does not apply to any
* modifications of the software.
*
* Notwithstanding the above, under no circumstances may you combine this
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
* $Id: 802.11e.h 241182 2011-02-17 21:50:03Z $
*/
#ifndef _802_11e_H_
#define _802_11e_H_
#ifndef _TYPEDEFS_H_
#include <typedefs.h>
#endif
/* This marks the start of a packed structure section. */
#include <packed_section_start.h>
/* WME Traffic Specification (TSPEC) element */
#define WME_TSPEC_HDR_LEN 2 /* WME TSPEC header length */
#define WME_TSPEC_BODY_OFF 2 /* WME TSPEC body offset */
#define WME_CATEGORY_CODE_OFFSET 0 /* WME Category code offset */
#define WME_ACTION_CODE_OFFSET 1 /* WME Action code offset */
#define WME_TOKEN_CODE_OFFSET 2 /* WME Token code offset */
#define WME_STATUS_CODE_OFFSET 3 /* WME Status code offset */
BWL_PRE_PACKED_STRUCT struct tsinfo {
uint8 octets[3];
} BWL_POST_PACKED_STRUCT;
typedef struct tsinfo tsinfo_t;
/* 802.11e TSPEC IE */
typedef BWL_PRE_PACKED_STRUCT struct tspec {
uint8 oui[DOT11_OUI_LEN]; /* WME_OUI */
uint8 type; /* WME_TYPE */
uint8 subtype; /* WME_SUBTYPE_TSPEC */
uint8 version; /* WME_VERSION */
tsinfo_t tsinfo; /* TS Info bit field */
uint16 nom_msdu_size; /* (Nominal or fixed) MSDU Size (bytes) */
uint16 max_msdu_size; /* Maximum MSDU Size (bytes) */
uint32 min_srv_interval; /* Minimum Service Interval (us) */
uint32 max_srv_interval; /* Maximum Service Interval (us) */
uint32 inactivity_interval; /* Inactivity Interval (us) */
uint32 suspension_interval; /* Suspension Interval (us) */
uint32 srv_start_time; /* Service Start Time (us) */
uint32 min_data_rate; /* Minimum Data Rate (bps) */
uint32 mean_data_rate; /* Mean Data Rate (bps) */
uint32 peak_data_rate; /* Peak Data Rate (bps) */
uint32 max_burst_size; /* Maximum Burst Size (bytes) */
uint32 delay_bound; /* Delay Bound (us) */
uint32 min_phy_rate; /* Minimum PHY Rate (bps) */
uint16 surplus_bw; /* Surplus Bandwidth Allowance (range 1.0-8.0) */
uint16 medium_time; /* Medium Time (32 us/s periods) */
} BWL_POST_PACKED_STRUCT tspec_t;
#define WME_TSPEC_LEN (sizeof(tspec_t)) /* not including 2-bytes of header */
/* ts_info */
/* 802.1D priority is duplicated - bits 13-11 AND bits 3-1 */
#define TS_INFO_TID_SHIFT 1 /* TS info. TID shift */
#define TS_INFO_TID_MASK (0xf << TS_INFO_TID_SHIFT) /* TS info. TID mask */
#define TS_INFO_CONTENTION_SHIFT 7 /* TS info. contention shift */
#define TS_INFO_CONTENTION_MASK (0x1 << TS_INFO_CONTENTION_SHIFT) /* TS info. contention mask */
#define TS_INFO_DIRECTION_SHIFT 5 /* TS info. direction shift */
#define TS_INFO_DIRECTION_MASK (0x3 << TS_INFO_DIRECTION_SHIFT) /* TS info. direction mask */
#define TS_INFO_PSB_SHIFT 2 /* TS info. PSB bit Shift */
#define TS_INFO_PSB_MASK (1 << TS_INFO_PSB_SHIFT) /* TS info. PSB mask */
#define TS_INFO_UPLINK (0 << TS_INFO_DIRECTION_SHIFT) /* TS info. uplink */
#define TS_INFO_DOWNLINK (1 << TS_INFO_DIRECTION_SHIFT) /* TS info. downlink */
#define TS_INFO_BIDIRECTIONAL (3 << TS_INFO_DIRECTION_SHIFT) /* TS info. bidirectional */
#define TS_INFO_USER_PRIO_SHIFT 3 /* TS info. user priority shift */
/* TS info. user priority mask */
#define TS_INFO_USER_PRIO_MASK (0x7 << TS_INFO_USER_PRIO_SHIFT)
/* Macro to get/set bit(s) field in TSINFO */
#define WLC_CAC_GET_TID(pt) ((((pt).octets[0]) & TS_INFO_TID_MASK) >> TS_INFO_TID_SHIFT)
#define WLC_CAC_GET_DIR(pt) ((((pt).octets[0]) & \
TS_INFO_DIRECTION_MASK) >> TS_INFO_DIRECTION_SHIFT)
#define WLC_CAC_GET_PSB(pt) ((((pt).octets[1]) & TS_INFO_PSB_MASK) >> TS_INFO_PSB_SHIFT)
#define WLC_CAC_GET_USER_PRIO(pt) ((((pt).octets[1]) & \
TS_INFO_USER_PRIO_MASK) >> TS_INFO_USER_PRIO_SHIFT)
#define WLC_CAC_SET_TID(pt, id) ((((pt).octets[0]) & (~TS_INFO_TID_MASK)) | \
((id) << TS_INFO_TID_SHIFT))
#define WLC_CAC_SET_USER_PRIO(pt, prio) ((((pt).octets[0]) & (~TS_INFO_USER_PRIO_MASK)) | \
((prio) << TS_INFO_USER_PRIO_SHIFT))
/* 802.11e QBSS Load IE */
#define QBSS_LOAD_IE_LEN 5 /* QBSS Load IE length */
#define QBSS_LOAD_AAC_OFF 3 /* AAC offset in IE */
#define CAC_ADDTS_RESP_TIMEOUT 300 /* default ADDTS response timeout in ms */
/* 802.11e ADDTS status code */
#define DOT11E_STATUS_ADMISSION_ACCEPTED 0 /* TSPEC Admission accepted status */
#define DOT11E_STATUS_ADDTS_INVALID_PARAM 1 /* TSPEC invalid parameter status */
#define DOT11E_STATUS_ADDTS_REFUSED_NSBW 3 /* ADDTS refused (non-sufficient BW) */
#define DOT11E_STATUS_ADDTS_REFUSED_AWHILE 47 /* ADDTS refused but could retry later */
/* 802.11e DELTS status code */
#define DOT11E_STATUS_QSTA_LEAVE_QBSS 36 /* STA leave QBSS */
#define DOT11E_STATUS_END_TS 37 /* END TS */
#define DOT11E_STATUS_UNKNOWN_TS 38 /* UNKNOWN TS */
#define DOT11E_STATUS_QSTA_REQ_TIMEOUT 39 /* STA ADDTS request timeout */
/* This marks the end of a packed structure section. */
#include <packed_section_end.h>
#endif /* _802_11e_CAC_H_ */

View File

@@ -0,0 +1,48 @@
/*
* Copyright (C) 1999-2012, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* under the terms of the GNU General Public License version 2 (the "GPL"),
* available at http://www.broadcom.com/licenses/GPLv2.php, with the
* following added to such license:
*
* As a special exception, the copyright holders of this software give you
* permission to link this software with independent modules, and to copy and
* distribute the resulting executable under terms of your choice, provided that
* you also meet, for each linked independent module, the terms and conditions of
* the license of that module. An independent module is a module which is not
* derived from this software. The special exception does not apply to any
* modifications of the software.
*
* Notwithstanding the above, under no circumstances may you combine this
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
* Fundamental types and constants relating to 802.1D
*
* $Id: 802.1d.h 241182 2011-02-17 21:50:03Z $
*/
#ifndef _802_1_D_
#define _802_1_D_
#define PRIO_8021D_NONE 2
#define PRIO_8021D_BK 1
#define PRIO_8021D_BE 0
#define PRIO_8021D_EE 3
#define PRIO_8021D_CL 4
#define PRIO_8021D_VI 5
#define PRIO_8021D_VO 6
#define PRIO_8021D_NC 7
#define MAXPRIO 7
#define NUMPRIO (MAXPRIO + 1)
#define ALLPRIO -1
#define PRIO2PREC(prio) \
(((prio) == PRIO_8021D_NONE || (prio) == PRIO_8021D_BE) ? ((prio^2)) : (prio))
#endif

View File

@@ -0,0 +1,82 @@
/*
* Broadcom Ethernettype protocol definitions
*
* Copyright (C) 1999-2012, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* under the terms of the GNU General Public License version 2 (the "GPL"),
* available at http://www.broadcom.com/licenses/GPLv2.php, with the
* following added to such license:
*
* As a special exception, the copyright holders of this software give you
* permission to link this software with independent modules, and to copy and
* distribute the resulting executable under terms of your choice, provided that
* you also meet, for each linked independent module, the terms and conditions of
* the license of that module. An independent module is a module which is not
* derived from this software. The special exception does not apply to any
* modifications of the software.
*
* Notwithstanding the above, under no circumstances may you combine this
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
* $Id: bcmeth.h 294352 2011-11-06 19:23:00Z $
*/
#ifndef _BCMETH_H_
#define _BCMETH_H_
#ifndef _TYPEDEFS_H_
#include <typedefs.h>
#endif
#include <packed_section_start.h>
#define BCMILCP_SUBTYPE_RATE 1
#define BCMILCP_SUBTYPE_LINK 2
#define BCMILCP_SUBTYPE_CSA 3
#define BCMILCP_SUBTYPE_LARQ 4
#define BCMILCP_SUBTYPE_VENDOR 5
#define BCMILCP_SUBTYPE_FLH 17
#define BCMILCP_SUBTYPE_VENDOR_LONG 32769
#define BCMILCP_SUBTYPE_CERT 32770
#define BCMILCP_SUBTYPE_SES 32771
#define BCMILCP_BCM_SUBTYPE_RESERVED 0
#define BCMILCP_BCM_SUBTYPE_EVENT 1
#define BCMILCP_BCM_SUBTYPE_SES 2
#define BCMILCP_BCM_SUBTYPE_DPT 4
#define BCMILCP_BCM_SUBTYPEHDR_MINLENGTH 8
#define BCMILCP_BCM_SUBTYPEHDR_VERSION 0
typedef BWL_PRE_PACKED_STRUCT struct bcmeth_hdr
{
uint16 subtype;
uint16 length;
uint8 version;
uint8 oui[3];
uint16 usr_subtype;
} BWL_POST_PACKED_STRUCT bcmeth_hdr_t;
#include <packed_section_end.h>
#endif

View File

@@ -0,0 +1,329 @@
/*
* Broadcom Event protocol definitions
*
* Copyright (C) 1999-2012, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* under the terms of the GNU General Public License version 2 (the "GPL"),
* available at http://www.broadcom.com/licenses/GPLv2.php, with the
* following added to such license:
*
* As a special exception, the copyright holders of this software give you
* permission to link this software with independent modules, and to copy and
* distribute the resulting executable under terms of your choice, provided that
* you also meet, for each linked independent module, the terms and conditions of
* the license of that module. An independent module is a module which is not
* derived from this software. The special exception does not apply to any
* modifications of the software.
*
* Notwithstanding the above, under no circumstances may you combine this
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
* Dependencies: proto/bcmeth.h
*
* $Id: bcmevent.h 326276 2012-04-06 23:16:42Z $
*
*/
#ifndef _BCMEVENT_H_
#define _BCMEVENT_H_
#ifndef _TYPEDEFS_H_
#include <typedefs.h>
#endif
#include <packed_section_start.h>
#define BCM_EVENT_MSG_VERSION 2
#define BCM_MSG_IFNAME_MAX 16
#define WLC_EVENT_MSG_LINK 0x01
#define WLC_EVENT_MSG_FLUSHTXQ 0x02
#define WLC_EVENT_MSG_GROUP 0x04
#define WLC_EVENT_MSG_UNKBSS 0x08
#define WLC_EVENT_MSG_UNKIF 0x10
typedef BWL_PRE_PACKED_STRUCT struct
{
uint16 version;
uint16 flags;
uint32 event_type;
uint32 status;
uint32 reason;
uint32 auth_type;
uint32 datalen;
struct ether_addr addr;
char ifname[BCM_MSG_IFNAME_MAX];
} BWL_POST_PACKED_STRUCT wl_event_msg_v1_t;
typedef BWL_PRE_PACKED_STRUCT struct
{
uint16 version;
uint16 flags;
uint32 event_type;
uint32 status;
uint32 reason;
uint32 auth_type;
uint32 datalen;
struct ether_addr addr;
char ifname[BCM_MSG_IFNAME_MAX];
uint8 ifidx;
uint8 bsscfgidx;
} BWL_POST_PACKED_STRUCT wl_event_msg_t;
typedef BWL_PRE_PACKED_STRUCT struct bcm_event {
struct ether_header eth;
bcmeth_hdr_t bcm_hdr;
wl_event_msg_t event;
} BWL_POST_PACKED_STRUCT bcm_event_t;
#define BCM_MSG_LEN (sizeof(bcm_event_t) - sizeof(bcmeth_hdr_t) - sizeof(struct ether_header))
#define WLC_E_SET_SSID 0
#define WLC_E_JOIN 1
#define WLC_E_START 2
#define WLC_E_AUTH 3
#define WLC_E_AUTH_IND 4
#define WLC_E_DEAUTH 5
#define WLC_E_DEAUTH_IND 6
#define WLC_E_ASSOC 7
#define WLC_E_ASSOC_IND 8
#define WLC_E_REASSOC 9
#define WLC_E_REASSOC_IND 10
#define WLC_E_DISASSOC 11
#define WLC_E_DISASSOC_IND 12
#define WLC_E_QUIET_START 13
#define WLC_E_QUIET_END 14
#define WLC_E_BEACON_RX 15
#define WLC_E_LINK 16
#define WLC_E_MIC_ERROR 17
#define WLC_E_NDIS_LINK 18
#define WLC_E_ROAM 19
#define WLC_E_TXFAIL 20
#define WLC_E_PMKID_CACHE 21
#define WLC_E_RETROGRADE_TSF 22
#define WLC_E_PRUNE 23
#define WLC_E_AUTOAUTH 24
#define WLC_E_EAPOL_MSG 25
#define WLC_E_SCAN_COMPLETE 26
#define WLC_E_ADDTS_IND 27
#define WLC_E_DELTS_IND 28
#define WLC_E_BCNSENT_IND 29
#define WLC_E_BCNRX_MSG 30
#define WLC_E_BCNLOST_MSG 31
#define WLC_E_ROAM_PREP 32
#define WLC_E_PFN_NET_FOUND 33
#define WLC_E_PFN_NET_LOST 34
#define WLC_E_RESET_COMPLETE 35
#define WLC_E_JOIN_START 36
#define WLC_E_ROAM_START 37
#define WLC_E_ASSOC_START 38
#define WLC_E_IBSS_ASSOC 39
#define WLC_E_RADIO 40
#define WLC_E_PSM_WATCHDOG 41
#define WLC_E_PROBREQ_MSG 44
#define WLC_E_SCAN_CONFIRM_IND 45
#define WLC_E_PSK_SUP 46
#define WLC_E_COUNTRY_CODE_CHANGED 47
#define WLC_E_EXCEEDED_MEDIUM_TIME 48
#define WLC_E_ICV_ERROR 49
#define WLC_E_UNICAST_DECODE_ERROR 50
#define WLC_E_MULTICAST_DECODE_ERROR 51
#define WLC_E_TRACE 52
#ifdef WLBTAMP
#define WLC_E_BTA_HCI_EVENT 53
#endif
#define WLC_E_IF 54
#define WLC_E_P2P_DISC_LISTEN_COMPLETE 55
#define WLC_E_RSSI 56
#define WLC_E_PFN_SCAN_COMPLETE 57
#define WLC_E_EXTLOG_MSG 58
#define WLC_E_ACTION_FRAME 59
#define WLC_E_ACTION_FRAME_COMPLETE 60
#define WLC_E_PRE_ASSOC_IND 61
#define WLC_E_PRE_REASSOC_IND 62
#define WLC_E_CHANNEL_ADOPTED 63
#define WLC_E_AP_STARTED 64
#define WLC_E_DFS_AP_STOP 65
#define WLC_E_DFS_AP_RESUME 66
#define WLC_E_WAI_STA_EVENT 67
#define WLC_E_WAI_MSG 68
#define WLC_E_ESCAN_RESULT 69
#define WLC_E_ACTION_FRAME_OFF_CHAN_COMPLETE 70
#define WLC_E_PROBRESP_MSG 71
#define WLC_E_P2P_PROBREQ_MSG 72
#define WLC_E_DCS_REQUEST 73
#define WLC_E_FIFO_CREDIT_MAP 74
#define WLC_E_ACTION_FRAME_RX 75
#define WLC_E_WAKE_EVENT 76
#define WLC_E_RM_COMPLETE 77
#define WLC_E_HTSFSYNC 78
#define WLC_E_OVERLAY_REQ 79
#define WLC_E_CSA_COMPLETE_IND 80
#define WLC_E_EXCESS_PM_WAKE_EVENT 81
#define WLC_E_PFN_SCAN_NONE 82
#define WLC_E_PFN_SCAN_ALLGONE 83
#define WLC_E_GTK_PLUMBED 84
#define WLC_E_ASSOC_IND_NDIS 85
#define WLC_E_REASSOC_IND_NDIS 86
#define WLC_E_ASSOC_REQ_IE 87
#define WLC_E_ASSOC_RESP_IE 88
#define WLC_E_ASSOC_RECREATED 89
#define WLC_E_ACTION_FRAME_RX_NDIS 90
#define WLC_E_AUTH_REQ 91
#define WLC_E_TDLS_PEER_EVENT 92
#define WLC_E_SPEEDY_RECREATE_FAIL 93
#define WLC_E_LAST 94
typedef struct {
uint event;
const char *name;
} bcmevent_name_t;
extern const bcmevent_name_t bcmevent_names[];
extern const int bcmevent_names_size;
#define WLC_E_STATUS_SUCCESS 0
#define WLC_E_STATUS_FAIL 1
#define WLC_E_STATUS_TIMEOUT 2
#define WLC_E_STATUS_NO_NETWORKS 3
#define WLC_E_STATUS_ABORT 4
#define WLC_E_STATUS_NO_ACK 5
#define WLC_E_STATUS_UNSOLICITED 6
#define WLC_E_STATUS_ATTEMPT 7
#define WLC_E_STATUS_PARTIAL 8
#define WLC_E_STATUS_NEWSCAN 9
#define WLC_E_STATUS_NEWASSOC 10
#define WLC_E_STATUS_11HQUIET 11
#define WLC_E_STATUS_SUPPRESS 12
#define WLC_E_STATUS_NOCHANS 13
#define WLC_E_STATUS_CS_ABORT 15
#define WLC_E_STATUS_ERROR 16
#define WLC_E_REASON_INITIAL_ASSOC 0
#define WLC_E_REASON_LOW_RSSI 1
#define WLC_E_REASON_DEAUTH 2
#define WLC_E_REASON_DISASSOC 3
#define WLC_E_REASON_BCNS_LOST 4
#define WLC_E_REASON_MINTXRATE 9
#define WLC_E_REASON_TXFAIL 10
#define WLC_E_REASON_FAST_ROAM_FAILED 5
#define WLC_E_REASON_DIRECTED_ROAM 6
#define WLC_E_REASON_TSPEC_REJECTED 7
#define WLC_E_REASON_BETTER_AP 8
#define WLC_E_REASON_REQUESTED_ROAM 11
#define WLC_E_PRUNE_ENCR_MISMATCH 1
#define WLC_E_PRUNE_BCAST_BSSID 2
#define WLC_E_PRUNE_MAC_DENY 3
#define WLC_E_PRUNE_MAC_NA 4
#define WLC_E_PRUNE_REG_PASSV 5
#define WLC_E_PRUNE_SPCT_MGMT 6
#define WLC_E_PRUNE_RADAR 7
#define WLC_E_RSN_MISMATCH 8
#define WLC_E_PRUNE_NO_COMMON_RATES 9
#define WLC_E_PRUNE_BASIC_RATES 10
#define WLC_E_PRUNE_CIPHER_NA 12
#define WLC_E_PRUNE_KNOWN_STA 13
#define WLC_E_PRUNE_WDS_PEER 15
#define WLC_E_PRUNE_QBSS_LOAD 16
#define WLC_E_PRUNE_HOME_AP 17
#define WLC_E_SUP_OTHER 0
#define WLC_E_SUP_DECRYPT_KEY_DATA 1
#define WLC_E_SUP_BAD_UCAST_WEP128 2
#define WLC_E_SUP_BAD_UCAST_WEP40 3
#define WLC_E_SUP_UNSUP_KEY_LEN 4
#define WLC_E_SUP_PW_KEY_CIPHER 5
#define WLC_E_SUP_MSG3_TOO_MANY_IE 6
#define WLC_E_SUP_MSG3_IE_MISMATCH 7
#define WLC_E_SUP_NO_INSTALL_FLAG 8
#define WLC_E_SUP_MSG3_NO_GTK 9
#define WLC_E_SUP_GRP_KEY_CIPHER 10
#define WLC_E_SUP_GRP_MSG1_NO_GTK 11
#define WLC_E_SUP_GTK_DECRYPT_FAIL 12
#define WLC_E_SUP_SEND_FAIL 13
#define WLC_E_SUP_DEAUTH 14
#define WLC_E_SUP_WPA_PSK_TMO 15
typedef BWL_PRE_PACKED_STRUCT struct wl_event_rx_frame_data {
uint16 version;
uint16 channel;
int32 rssi;
uint32 mactime;
uint32 rate;
} BWL_POST_PACKED_STRUCT wl_event_rx_frame_data_t;
#define BCM_RX_FRAME_DATA_VERSION 1
typedef struct wl_event_data_if {
uint8 ifidx;
uint8 opcode;
uint8 reserved;
uint8 bssidx;
uint8 role;
} wl_event_data_if_t;
#define WLC_E_IF_ADD 1
#define WLC_E_IF_DEL 2
#define WLC_E_IF_CHANGE 3
#define WLC_E_IF_ROLE_STA 0
#define WLC_E_IF_ROLE_AP 1
#define WLC_E_IF_ROLE_WDS 2
#define WLC_E_IF_ROLE_P2P_GO 3
#define WLC_E_IF_ROLE_P2P_CLIENT 4
#ifdef WLBTAMP
#define WLC_E_IF_ROLE_BTA_CREATOR 5
#define WLC_E_IF_ROLE_BTA_ACCEPTOR 6
#endif
#define WLC_E_LINK_BCN_LOSS 1
#define WLC_E_LINK_DISASSOC 2
#define WLC_E_LINK_ASSOC_REC 3
#define WLC_E_LINK_BSSCFG_DIS 4
#define WLC_E_OVL_DOWNLOAD 0
#define WLC_E_OVL_UPDATE_IND 1
#define WLC_E_TDLS_PEER_DISCOVERED 0
#define WLC_E_TDLS_PEER_CONNECTED 1
#define WLC_E_TDLS_PEER_DISCONNECTED 2
#include <packed_section_end.h>
#endif

View File

@@ -0,0 +1,210 @@
/*
* Copyright (C) 1999-2012, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* under the terms of the GNU General Public License version 2 (the "GPL"),
* available at http://www.broadcom.com/licenses/GPLv2.php, with the
* following added to such license:
*
* As a special exception, the copyright holders of this software give you
* permission to link this software with independent modules, and to copy and
* distribute the resulting executable under terms of your choice, provided that
* you also meet, for each linked independent module, the terms and conditions of
* the license of that module. An independent module is a module which is not
* derived from this software. The special exception does not apply to any
* modifications of the software.
*
* Notwithstanding the above, under no circumstances may you combine this
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
* Fundamental constants relating to IP Protocol
*
* $Id: bcmip.h 290206 2011-10-17 19:13:51Z $
*/
#ifndef _bcmip_h_
#define _bcmip_h_
#ifndef _TYPEDEFS_H_
#include <typedefs.h>
#endif
#include <packed_section_start.h>
#define IP_VER_OFFSET 0x0
#define IP_VER_MASK 0xf0
#define IP_VER_SHIFT 4
#define IP_VER_4 4
#define IP_VER_6 6
#define IP_VER(ip_body) \
((((uint8 *)(ip_body))[IP_VER_OFFSET] & IP_VER_MASK) >> IP_VER_SHIFT)
#define IP_PROT_ICMP 0x1
#define IP_PROT_IGMP 0x2
#define IP_PROT_TCP 0x6
#define IP_PROT_UDP 0x11
#define IP_PROT_ICMP6 0x3a
#define IPV4_VER_HL_OFFSET 0
#define IPV4_TOS_OFFSET 1
#define IPV4_PKTLEN_OFFSET 2
#define IPV4_PKTFLAG_OFFSET 6
#define IPV4_PROT_OFFSET 9
#define IPV4_CHKSUM_OFFSET 10
#define IPV4_SRC_IP_OFFSET 12
#define IPV4_DEST_IP_OFFSET 16
#define IPV4_OPTIONS_OFFSET 20
#define IPV4_VER_MASK 0xf0
#define IPV4_VER_SHIFT 4
#define IPV4_HLEN_MASK 0x0f
#define IPV4_HLEN(ipv4_body) (4 * (((uint8 *)(ipv4_body))[IPV4_VER_HL_OFFSET] & IPV4_HLEN_MASK))
#define IPV4_ADDR_LEN 4
#define IPV4_ADDR_NULL(a) ((((uint8 *)(a))[0] | ((uint8 *)(a))[1] | \
((uint8 *)(a))[2] | ((uint8 *)(a))[3]) == 0)
#define IPV4_ADDR_BCAST(a) ((((uint8 *)(a))[0] & ((uint8 *)(a))[1] & \
((uint8 *)(a))[2] & ((uint8 *)(a))[3]) == 0xff)
#define IPV4_TOS_DSCP_MASK 0xfc
#define IPV4_TOS_DSCP_SHIFT 2
#define IPV4_TOS(ipv4_body) (((uint8 *)(ipv4_body))[IPV4_TOS_OFFSET])
#define IPV4_TOS_PREC_MASK 0xe0
#define IPV4_TOS_PREC_SHIFT 5
#define IPV4_TOS_LOWDELAY 0x10
#define IPV4_TOS_THROUGHPUT 0x8
#define IPV4_TOS_RELIABILITY 0x4
#define IPV4_PROT(ipv4_body) (((uint8 *)(ipv4_body))[IPV4_PROT_OFFSET])
#define IPV4_FRAG_RESV 0x8000
#define IPV4_FRAG_DONT 0x4000
#define IPV4_FRAG_MORE 0x2000
#define IPV4_FRAG_OFFSET_MASK 0x1fff
#define IPV4_ADDR_STR_LEN 16
BWL_PRE_PACKED_STRUCT struct ipv4_addr {
uint8 addr[IPV4_ADDR_LEN];
} BWL_POST_PACKED_STRUCT;
BWL_PRE_PACKED_STRUCT struct ipv4_hdr {
uint8 version_ihl;
uint8 tos;
uint16 tot_len;
uint16 id;
uint16 frag;
uint8 ttl;
uint8 prot;
uint16 hdr_chksum;
uint8 src_ip[IPV4_ADDR_LEN];
uint8 dst_ip[IPV4_ADDR_LEN];
} BWL_POST_PACKED_STRUCT;
#define IPV6_PAYLOAD_LEN_OFFSET 4
#define IPV6_NEXT_HDR_OFFSET 6
#define IPV6_HOP_LIMIT_OFFSET 7
#define IPV6_SRC_IP_OFFSET 8
#define IPV6_DEST_IP_OFFSET 24
#define IPV6_TRAFFIC_CLASS(ipv6_body) \
(((((uint8 *)(ipv6_body))[0] & 0x0f) << 4) | \
((((uint8 *)(ipv6_body))[1] & 0xf0) >> 4))
#define IPV6_FLOW_LABEL(ipv6_body) \
(((((uint8 *)(ipv6_body))[1] & 0x0f) << 16) | \
(((uint8 *)(ipv6_body))[2] << 8) | \
(((uint8 *)(ipv6_body))[3]))
#define IPV6_PAYLOAD_LEN(ipv6_body) \
((((uint8 *)(ipv6_body))[IPV6_PAYLOAD_LEN_OFFSET + 0] << 8) | \
((uint8 *)(ipv6_body))[IPV6_PAYLOAD_LEN_OFFSET + 1])
#define IPV6_NEXT_HDR(ipv6_body) \
(((uint8 *)(ipv6_body))[IPV6_NEXT_HDR_OFFSET])
#define IPV6_PROT(ipv6_body) IPV6_NEXT_HDR(ipv6_body)
#define IPV6_ADDR_LEN 16
#define IP_TOS46(ip_body) \
(IP_VER(ip_body) == IP_VER_4 ? IPV4_TOS(ip_body) : \
IP_VER(ip_body) == IP_VER_6 ? IPV6_TRAFFIC_CLASS(ip_body) : 0)
#define IPV6_EXTHDR_HOP 0
#define IPV6_EXTHDR_ROUTING 43
#define IPV6_EXTHDR_FRAGMENT 44
#define IPV6_EXTHDR_AUTH 51
#define IPV6_EXTHDR_NONE 59
#define IPV6_EXTHDR_DEST 60
#define IPV6_EXTHDR(prot) (((prot) == IPV6_EXTHDR_HOP) || \
((prot) == IPV6_EXTHDR_ROUTING) || \
((prot) == IPV6_EXTHDR_FRAGMENT) || \
((prot) == IPV6_EXTHDR_AUTH) || \
((prot) == IPV6_EXTHDR_NONE) || \
((prot) == IPV6_EXTHDR_DEST))
#define IPV6_MIN_HLEN 40
#define IPV6_EXTHDR_LEN(eh) ((((struct ipv6_exthdr *)(eh))->hdrlen + 1) << 3)
BWL_PRE_PACKED_STRUCT struct ipv6_exthdr {
uint8 nexthdr;
uint8 hdrlen;
} BWL_POST_PACKED_STRUCT;
BWL_PRE_PACKED_STRUCT struct ipv6_exthdr_frag {
uint8 nexthdr;
uint8 rsvd;
uint16 frag_off;
uint32 ident;
} BWL_POST_PACKED_STRUCT;
static INLINE int32
ipv6_exthdr_len(uint8 *h, uint8 *proto)
{
uint16 len = 0, hlen;
struct ipv6_exthdr *eh = (struct ipv6_exthdr *)h;
while (IPV6_EXTHDR(eh->nexthdr)) {
if (eh->nexthdr == IPV6_EXTHDR_NONE)
return -1;
else if (eh->nexthdr == IPV6_EXTHDR_FRAGMENT)
hlen = 8;
else if (eh->nexthdr == IPV6_EXTHDR_AUTH)
hlen = (eh->hdrlen + 2) << 2;
else
hlen = IPV6_EXTHDR_LEN(eh);
len += hlen;
eh = (struct ipv6_exthdr *)(h + len);
}
*proto = eh->nexthdr;
return len;
}
#include <packed_section_end.h>
#endif

View File

@@ -0,0 +1,104 @@
/*
* Copyright (C) 1999-2012, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* under the terms of the GNU General Public License version 2 (the "GPL"),
* available at http://www.broadcom.com/licenses/GPLv2.php, with the
* following added to such license:
*
* As a special exception, the copyright holders of this software give you
* permission to link this software with independent modules, and to copy and
* distribute the resulting executable under terms of your choice, provided that
* you also meet, for each linked independent module, the terms and conditions of
* the license of that module. An independent module is a module which is not
* derived from this software. The special exception does not apply to any
* modifications of the software.
*
* Notwithstanding the above, under no circumstances may you combine this
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
* Fundamental constants relating to Neighbor Discovery Protocol
*
* $Id: bcmipv6.h 309193 2012-01-19 00:03:57Z $
*/
#ifndef _bcmipv6_h_
#define _bcmipv6_h_
#ifndef _TYPEDEFS_H_
#include <typedefs.h>
#endif
/* This marks the start of a packed structure section. */
#include <packed_section_start.h>
#define ICMPV6_HEADER_TYPE 0x3A
#define ICMPV6_PKT_TYPE_NS 135
#define ICMPV6_PKT_TYPE_NA 136
#define ICMPV6_ND_OPT_TYPE_TARGET_MAC 2
#define ICMPV6_ND_OPT_TYPE_SRC_MAC 1
#define IPV6_VERSION 6
#define IPV6_HOP_LIMIT 255
#define IPV6_ADDR_NULL(a) ((a[0] | a[1] | a[2] | a[3] | a[4] | \
a[5] | a[6] | a[7] | a[8] | a[9] | \
a[10] | a[11] | a[12] | a[13] | \
a[14] | a[15]) == 0)
/* IPV6 address */
BWL_PRE_PACKED_STRUCT struct ipv6_addr {
uint8 addr[16];
} BWL_POST_PACKED_STRUCT;
/* ICMPV6 Header */
BWL_PRE_PACKED_STRUCT struct icmp6_hdr {
uint8 icmp6_type;
uint8 icmp6_code;
uint16 icmp6_cksum;
BWL_PRE_PACKED_STRUCT union {
uint32 reserved;
BWL_PRE_PACKED_STRUCT struct nd_advt {
uint32 reserved1:5,
override:1,
solicited:1,
router:1,
reserved2:24;
} BWL_POST_PACKED_STRUCT nd_advt;
} BWL_POST_PACKED_STRUCT opt;
} BWL_POST_PACKED_STRUCT;
/* Ipv6 Header Format */
BWL_PRE_PACKED_STRUCT struct ipv6_hdr {
uint8 priority:4,
version:4;
uint8 flow_lbl[3];
uint16 payload_len;
uint8 nexthdr;
uint8 hop_limit;
struct ipv6_addr saddr;
struct ipv6_addr daddr;
} BWL_POST_PACKED_STRUCT;
/* Neighbor Advertisement/Solicitation Packet Structure */
BWL_PRE_PACKED_STRUCT struct nd_msg {
struct icmp6_hdr icmph;
struct ipv6_addr target;
} BWL_POST_PACKED_STRUCT;
/* Neighibor Solicitation/Advertisement Optional Structure */
BWL_PRE_PACKED_STRUCT struct nd_msg_opt {
uint8 type;
uint8 len;
uint8 mac_addr[ETHER_ADDR_LEN];
} BWL_POST_PACKED_STRUCT;
/* This marks the end of a packed structure section. */
#include <packed_section_end.h>
#endif /* !defined(_bcmipv6_h_) */

View File

@@ -0,0 +1,441 @@
/*
* BT-AMP (BlueTooth Alternate Mac and Phy) HCI (Host/Controller Interface)
*
* Copyright (C) 1999-2012, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* under the terms of the GNU General Public License version 2 (the "GPL"),
* available at http://www.broadcom.com/licenses/GPLv2.php, with the
* following added to such license:
*
* As a special exception, the copyright holders of this software give you
* permission to link this software with independent modules, and to copy and
* distribute the resulting executable under terms of your choice, provided that
* you also meet, for each linked independent module, the terms and conditions of
* the license of that module. An independent module is a module which is not
* derived from this software. The special exception does not apply to any
* modifications of the software.
*
* Notwithstanding the above, under no circumstances may you combine this
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
* $Id: bt_amp_hci.h 294267 2011-11-04 23:41:52Z $
*/
#ifndef _bt_amp_hci_h
#define _bt_amp_hci_h
/* This marks the start of a packed structure section. */
#include <packed_section_start.h>
/* AMP HCI CMD packet format */
typedef BWL_PRE_PACKED_STRUCT struct amp_hci_cmd {
uint16 opcode;
uint8 plen;
uint8 parms[1];
} BWL_POST_PACKED_STRUCT amp_hci_cmd_t;
#define HCI_CMD_PREAMBLE_SIZE OFFSETOF(amp_hci_cmd_t, parms)
#define HCI_CMD_DATA_SIZE 255
/* AMP HCI CMD opcode layout */
#define HCI_CMD_OPCODE(ogf, ocf) ((((ogf) & 0x3F) << 10) | ((ocf) & 0x03FF))
#define HCI_CMD_OGF(opcode) ((uint8)(((opcode) >> 10) & 0x3F))
#define HCI_CMD_OCF(opcode) ((opcode) & 0x03FF)
/* AMP HCI command opcodes */
#define HCI_Read_Failed_Contact_Counter HCI_CMD_OPCODE(0x05, 0x0001)
#define HCI_Reset_Failed_Contact_Counter HCI_CMD_OPCODE(0x05, 0x0002)
#define HCI_Read_Link_Quality HCI_CMD_OPCODE(0x05, 0x0003)
#define HCI_Read_Local_AMP_Info HCI_CMD_OPCODE(0x05, 0x0009)
#define HCI_Read_Local_AMP_ASSOC HCI_CMD_OPCODE(0x05, 0x000A)
#define HCI_Write_Remote_AMP_ASSOC HCI_CMD_OPCODE(0x05, 0x000B)
#define HCI_Create_Physical_Link HCI_CMD_OPCODE(0x01, 0x0035)
#define HCI_Accept_Physical_Link_Request HCI_CMD_OPCODE(0x01, 0x0036)
#define HCI_Disconnect_Physical_Link HCI_CMD_OPCODE(0x01, 0x0037)
#define HCI_Create_Logical_Link HCI_CMD_OPCODE(0x01, 0x0038)
#define HCI_Accept_Logical_Link HCI_CMD_OPCODE(0x01, 0x0039)
#define HCI_Disconnect_Logical_Link HCI_CMD_OPCODE(0x01, 0x003A)
#define HCI_Logical_Link_Cancel HCI_CMD_OPCODE(0x01, 0x003B)
#define HCI_Flow_Spec_Modify HCI_CMD_OPCODE(0x01, 0x003C)
#define HCI_Write_Flow_Control_Mode HCI_CMD_OPCODE(0x01, 0x0067)
#define HCI_Read_Best_Effort_Flush_Timeout HCI_CMD_OPCODE(0x01, 0x0069)
#define HCI_Write_Best_Effort_Flush_Timeout HCI_CMD_OPCODE(0x01, 0x006A)
#define HCI_Short_Range_Mode HCI_CMD_OPCODE(0x01, 0x006B)
#define HCI_Reset HCI_CMD_OPCODE(0x03, 0x0003)
#define HCI_Read_Connection_Accept_Timeout HCI_CMD_OPCODE(0x03, 0x0015)
#define HCI_Write_Connection_Accept_Timeout HCI_CMD_OPCODE(0x03, 0x0016)
#define HCI_Read_Link_Supervision_Timeout HCI_CMD_OPCODE(0x03, 0x0036)
#define HCI_Write_Link_Supervision_Timeout HCI_CMD_OPCODE(0x03, 0x0037)
#define HCI_Enhanced_Flush HCI_CMD_OPCODE(0x03, 0x005F)
#define HCI_Read_Logical_Link_Accept_Timeout HCI_CMD_OPCODE(0x03, 0x0061)
#define HCI_Write_Logical_Link_Accept_Timeout HCI_CMD_OPCODE(0x03, 0x0062)
#define HCI_Set_Event_Mask_Page_2 HCI_CMD_OPCODE(0x03, 0x0063)
#define HCI_Read_Location_Data_Command HCI_CMD_OPCODE(0x03, 0x0064)
#define HCI_Write_Location_Data_Command HCI_CMD_OPCODE(0x03, 0x0065)
#define HCI_Read_Local_Version_Info HCI_CMD_OPCODE(0x04, 0x0001)
#define HCI_Read_Local_Supported_Commands HCI_CMD_OPCODE(0x04, 0x0002)
#define HCI_Read_Buffer_Size HCI_CMD_OPCODE(0x04, 0x0005)
#define HCI_Read_Data_Block_Size HCI_CMD_OPCODE(0x04, 0x000A)
/* AMP HCI command parameters */
typedef BWL_PRE_PACKED_STRUCT struct read_local_cmd_parms {
uint8 plh;
uint8 offset[2]; /* length so far */
uint8 max_remote[2];
} BWL_POST_PACKED_STRUCT read_local_cmd_parms_t;
typedef BWL_PRE_PACKED_STRUCT struct write_remote_cmd_parms {
uint8 plh;
uint8 offset[2];
uint8 len[2];
uint8 frag[1];
} BWL_POST_PACKED_STRUCT write_remote_cmd_parms_t;
typedef BWL_PRE_PACKED_STRUCT struct phy_link_cmd_parms {
uint8 plh;
uint8 key_length;
uint8 key_type;
uint8 key[1];
} BWL_POST_PACKED_STRUCT phy_link_cmd_parms_t;
typedef BWL_PRE_PACKED_STRUCT struct dis_phy_link_cmd_parms {
uint8 plh;
uint8 reason;
} BWL_POST_PACKED_STRUCT dis_phy_link_cmd_parms_t;
typedef BWL_PRE_PACKED_STRUCT struct log_link_cmd_parms {
uint8 plh;
uint8 txflow[16];
uint8 rxflow[16];
} BWL_POST_PACKED_STRUCT log_link_cmd_parms_t;
typedef BWL_PRE_PACKED_STRUCT struct ext_flow_spec {
uint8 id;
uint8 service_type;
uint8 max_sdu[2];
uint8 sdu_ia_time[4];
uint8 access_latency[4];
uint8 flush_timeout[4];
} BWL_POST_PACKED_STRUCT ext_flow_spec_t;
typedef BWL_PRE_PACKED_STRUCT struct log_link_cancel_cmd_parms {
uint8 plh;
uint8 tx_fs_ID;
} BWL_POST_PACKED_STRUCT log_link_cancel_cmd_parms_t;
typedef BWL_PRE_PACKED_STRUCT struct flow_spec_mod_cmd_parms {
uint8 llh[2];
uint8 txflow[16];
uint8 rxflow[16];
} BWL_POST_PACKED_STRUCT flow_spec_mod_cmd_parms_t;
typedef BWL_PRE_PACKED_STRUCT struct plh_pad {
uint8 plh;
uint8 pad;
} BWL_POST_PACKED_STRUCT plh_pad_t;
typedef BWL_PRE_PACKED_STRUCT union hci_handle {
uint16 bredr;
plh_pad_t amp;
} BWL_POST_PACKED_STRUCT hci_handle_t;
typedef BWL_PRE_PACKED_STRUCT struct ls_to_cmd_parms {
hci_handle_t handle;
uint8 timeout[2];
} BWL_POST_PACKED_STRUCT ls_to_cmd_parms_t;
typedef BWL_PRE_PACKED_STRUCT struct befto_cmd_parms {
uint8 llh[2];
uint8 befto[4];
} BWL_POST_PACKED_STRUCT befto_cmd_parms_t;
typedef BWL_PRE_PACKED_STRUCT struct srm_cmd_parms {
uint8 plh;
uint8 srm;
} BWL_POST_PACKED_STRUCT srm_cmd_parms_t;
typedef BWL_PRE_PACKED_STRUCT struct ld_cmd_parms {
uint8 ld_aware;
uint8 ld[2];
uint8 ld_opts;
uint8 l_opts;
} BWL_POST_PACKED_STRUCT ld_cmd_parms_t;
typedef BWL_PRE_PACKED_STRUCT struct eflush_cmd_parms {
uint8 llh[2];
uint8 packet_type;
} BWL_POST_PACKED_STRUCT eflush_cmd_parms_t;
/* Generic AMP extended flow spec service types */
#define EFS_SVCTYPE_NO_TRAFFIC 0
#define EFS_SVCTYPE_BEST_EFFORT 1
#define EFS_SVCTYPE_GUARANTEED 2
/* AMP HCI event packet format */
typedef BWL_PRE_PACKED_STRUCT struct amp_hci_event {
uint8 ecode;
uint8 plen;
uint8 parms[1];
} BWL_POST_PACKED_STRUCT amp_hci_event_t;
#define HCI_EVT_PREAMBLE_SIZE OFFSETOF(amp_hci_event_t, parms)
/* AMP HCI event codes */
#define HCI_Command_Complete 0x0E
#define HCI_Command_Status 0x0F
#define HCI_Flush_Occurred 0x11
#define HCI_Enhanced_Flush_Complete 0x39
#define HCI_Physical_Link_Complete 0x40
#define HCI_Channel_Select 0x41
#define HCI_Disconnect_Physical_Link_Complete 0x42
#define HCI_Logical_Link_Complete 0x45
#define HCI_Disconnect_Logical_Link_Complete 0x46
#define HCI_Flow_Spec_Modify_Complete 0x47
#define HCI_Number_of_Completed_Data_Blocks 0x48
#define HCI_Short_Range_Mode_Change_Complete 0x4C
#define HCI_Status_Change_Event 0x4D
#define HCI_Vendor_Specific 0xFF
/* AMP HCI event mask bit positions */
#define HCI_Physical_Link_Complete_Event_Mask 0x0001
#define HCI_Channel_Select_Event_Mask 0x0002
#define HCI_Disconnect_Physical_Link_Complete_Event_Mask 0x0004
#define HCI_Logical_Link_Complete_Event_Mask 0x0020
#define HCI_Disconnect_Logical_Link_Complete_Event_Mask 0x0040
#define HCI_Flow_Spec_Modify_Complete_Event_Mask 0x0080
#define HCI_Number_of_Completed_Data_Blocks_Event_Mask 0x0100
#define HCI_Short_Range_Mode_Change_Complete_Event_Mask 0x1000
#define HCI_Status_Change_Event_Mask 0x2000
#define HCI_All_Event_Mask 0x31e7
/* AMP HCI event parameters */
typedef BWL_PRE_PACKED_STRUCT struct cmd_status_parms {
uint8 status;
uint8 cmdpkts;
uint16 opcode;
} BWL_POST_PACKED_STRUCT cmd_status_parms_t;
typedef BWL_PRE_PACKED_STRUCT struct cmd_complete_parms {
uint8 cmdpkts;
uint16 opcode;
uint8 parms[1];
} BWL_POST_PACKED_STRUCT cmd_complete_parms_t;
typedef BWL_PRE_PACKED_STRUCT struct flush_occurred_evt_parms {
uint16 handle;
} BWL_POST_PACKED_STRUCT flush_occurred_evt_parms_t;
typedef BWL_PRE_PACKED_STRUCT struct write_remote_evt_parms {
uint8 status;
uint8 plh;
} BWL_POST_PACKED_STRUCT write_remote_evt_parms_t;
typedef BWL_PRE_PACKED_STRUCT struct read_local_evt_parms {
uint8 status;
uint8 plh;
uint16 len;
uint8 frag[1];
} BWL_POST_PACKED_STRUCT read_local_evt_parms_t;
typedef BWL_PRE_PACKED_STRUCT struct read_local_info_evt_parms {
uint8 status;
uint8 AMP_status;
uint32 bandwidth;
uint32 gbandwidth;
uint32 latency;
uint32 PDU_size;
uint8 ctrl_type;
uint16 PAL_cap;
uint16 AMP_ASSOC_len;
uint32 max_flush_timeout;
uint32 be_flush_timeout;
} BWL_POST_PACKED_STRUCT read_local_info_evt_parms_t;
typedef BWL_PRE_PACKED_STRUCT struct log_link_evt_parms {
uint8 status;
uint16 llh;
uint8 plh;
uint8 tx_fs_ID;
} BWL_POST_PACKED_STRUCT log_link_evt_parms_t;
typedef BWL_PRE_PACKED_STRUCT struct disc_log_link_evt_parms {
uint8 status;
uint16 llh;
uint8 reason;
} BWL_POST_PACKED_STRUCT disc_log_link_evt_parms_t;
typedef BWL_PRE_PACKED_STRUCT struct log_link_cancel_evt_parms {
uint8 status;
uint8 plh;
uint8 tx_fs_ID;
} BWL_POST_PACKED_STRUCT log_link_cancel_evt_parms_t;
typedef BWL_PRE_PACKED_STRUCT struct flow_spec_mod_evt_parms {
uint8 status;
uint16 llh;
} BWL_POST_PACKED_STRUCT flow_spec_mod_evt_parms_t;
typedef BWL_PRE_PACKED_STRUCT struct phy_link_evt_parms {
uint8 status;
uint8 plh;
} BWL_POST_PACKED_STRUCT phy_link_evt_parms_t;
typedef BWL_PRE_PACKED_STRUCT struct dis_phy_link_evt_parms {
uint8 status;
uint8 plh;
uint8 reason;
} BWL_POST_PACKED_STRUCT dis_phy_link_evt_parms_t;
typedef BWL_PRE_PACKED_STRUCT struct read_ls_to_evt_parms {
uint8 status;
hci_handle_t handle;
uint16 timeout;
} BWL_POST_PACKED_STRUCT read_ls_to_evt_parms_t;
typedef BWL_PRE_PACKED_STRUCT struct read_lla_ca_to_evt_parms {
uint8 status;
uint16 timeout;
} BWL_POST_PACKED_STRUCT read_lla_ca_to_evt_parms_t;
typedef BWL_PRE_PACKED_STRUCT struct read_data_block_size_evt_parms {
uint8 status;
uint16 ACL_pkt_len;
uint16 data_block_len;
uint16 data_block_num;
} BWL_POST_PACKED_STRUCT read_data_block_size_evt_parms_t;
typedef BWL_PRE_PACKED_STRUCT struct data_blocks {
uint16 handle;
uint16 pkts;
uint16 blocks;
} BWL_POST_PACKED_STRUCT data_blocks_t;
typedef BWL_PRE_PACKED_STRUCT struct num_completed_data_blocks_evt_parms {
uint16 num_blocks;
uint8 num_handles;
data_blocks_t completed[1];
} BWL_POST_PACKED_STRUCT num_completed_data_blocks_evt_parms_t;
typedef BWL_PRE_PACKED_STRUCT struct befto_evt_parms {
uint8 status;
uint32 befto;
} BWL_POST_PACKED_STRUCT befto_evt_parms_t;
typedef BWL_PRE_PACKED_STRUCT struct srm_evt_parms {
uint8 status;
uint8 plh;
uint8 srm;
} BWL_POST_PACKED_STRUCT srm_evt_parms_t;
typedef BWL_PRE_PACKED_STRUCT struct contact_counter_evt_parms {
uint8 status;
uint8 llh[2];
uint16 counter;
} BWL_POST_PACKED_STRUCT contact_counter_evt_parms_t;
typedef BWL_PRE_PACKED_STRUCT struct contact_counter_reset_evt_parms {
uint8 status;
uint8 llh[2];
} BWL_POST_PACKED_STRUCT contact_counter_reset_evt_parms_t;
typedef BWL_PRE_PACKED_STRUCT struct read_linkq_evt_parms {
uint8 status;
hci_handle_t handle;
uint8 link_quality;
} BWL_POST_PACKED_STRUCT read_linkq_evt_parms_t;
typedef BWL_PRE_PACKED_STRUCT struct ld_evt_parms {
uint8 status;
uint8 ld_aware;
uint8 ld[2];
uint8 ld_opts;
uint8 l_opts;
} BWL_POST_PACKED_STRUCT ld_evt_parms_t;
typedef BWL_PRE_PACKED_STRUCT struct eflush_complete_evt_parms {
uint16 handle;
} BWL_POST_PACKED_STRUCT eflush_complete_evt_parms_t;
typedef BWL_PRE_PACKED_STRUCT struct vendor_specific_evt_parms {
uint8 len;
uint8 parms[1];
} BWL_POST_PACKED_STRUCT vendor_specific_evt_parms_t;
typedef BWL_PRE_PACKED_STRUCT struct local_version_info_evt_parms {
uint8 status;
uint8 hci_version;
uint16 hci_revision;
uint8 pal_version;
uint16 mfg_name;
uint16 pal_subversion;
} BWL_POST_PACKED_STRUCT local_version_info_evt_parms_t;
#define MAX_SUPPORTED_CMD_BYTE 64
typedef BWL_PRE_PACKED_STRUCT struct local_supported_cmd_evt_parms {
uint8 status;
uint8 cmd[MAX_SUPPORTED_CMD_BYTE];
} BWL_POST_PACKED_STRUCT local_supported_cmd_evt_parms_t;
typedef BWL_PRE_PACKED_STRUCT struct status_change_evt_parms {
uint8 status;
uint8 amp_status;
} BWL_POST_PACKED_STRUCT status_change_evt_parms_t;
/* AMP HCI error codes */
#define HCI_SUCCESS 0x00
#define HCI_ERR_ILLEGAL_COMMAND 0x01
#define HCI_ERR_NO_CONNECTION 0x02
#define HCI_ERR_MEMORY_FULL 0x07
#define HCI_ERR_CONNECTION_TIMEOUT 0x08
#define HCI_ERR_MAX_NUM_OF_CONNECTIONS 0x09
#define HCI_ERR_CONNECTION_EXISTS 0x0B
#define HCI_ERR_CONNECTION_DISALLOWED 0x0C
#define HCI_ERR_CONNECTION_ACCEPT_TIMEOUT 0x10
#define HCI_ERR_UNSUPPORTED_VALUE 0x11
#define HCI_ERR_ILLEGAL_PARAMETER_FMT 0x12
#define HCI_ERR_CONN_TERM_BY_LOCAL_HOST 0x16
#define HCI_ERR_UNSPECIFIED 0x1F
#define HCI_ERR_UNIT_KEY_USED 0x26
#define HCI_ERR_QOS_REJECTED 0x2D
#define HCI_ERR_PARAM_OUT_OF_RANGE 0x30
#define HCI_ERR_NO_SUITABLE_CHANNEL 0x39
#define HCI_ERR_CHANNEL_MOVE 0xFF
/* AMP HCI ACL Data packet format */
typedef BWL_PRE_PACKED_STRUCT struct amp_hci_ACL_data {
uint16 handle; /* 12-bit connection handle + 2-bit PB and 2-bit BC flags */
uint16 dlen; /* data total length */
uint8 data[1];
} BWL_POST_PACKED_STRUCT amp_hci_ACL_data_t;
#define HCI_ACL_DATA_PREAMBLE_SIZE OFFSETOF(amp_hci_ACL_data_t, data)
#define HCI_ACL_DATA_BC_FLAGS (0x0 << 14)
#define HCI_ACL_DATA_PB_FLAGS (0x3 << 12)
#define HCI_ACL_DATA_HANDLE(handle) ((handle) & 0x0fff)
#define HCI_ACL_DATA_FLAGS(handle) ((handle) >> 12)
/* AMP Activity Report packet formats */
typedef BWL_PRE_PACKED_STRUCT struct amp_hci_activity_report {
uint8 ScheduleKnown;
uint8 NumReports;
uint8 data[1];
} BWL_POST_PACKED_STRUCT amp_hci_activity_report_t;
typedef BWL_PRE_PACKED_STRUCT struct amp_hci_activity_report_triple {
uint32 StartTime;
uint32 Duration;
uint32 Periodicity;
} BWL_POST_PACKED_STRUCT amp_hci_activity_report_triple_t;
#define HCI_AR_SCHEDULE_KNOWN 0x01
/* This marks the end of a packed structure section. */
#include <packed_section_end.h>
#endif /* _bt_amp_hci_h_ */

View File

@@ -0,0 +1,193 @@
/*
* 802.1x EAPOL definitions
*
* See
* IEEE Std 802.1X-2001
* IEEE 802.1X RADIUS Usage Guidelines
*
* Copyright (C) 2002 Broadcom Corporation
*
* $Id: eapol.h 241182 2011-02-17 21:50:03Z $
*/
#ifndef _eapol_h_
#define _eapol_h_
#ifndef _TYPEDEFS_H_
#include <typedefs.h>
#endif
/* This marks the start of a packed structure section. */
#include <packed_section_start.h>
#include <bcmcrypto/aeskeywrap.h>
/* EAPOL for 802.3/Ethernet */
typedef BWL_PRE_PACKED_STRUCT struct {
struct ether_header eth; /* 802.3/Ethernet header */
unsigned char version; /* EAPOL protocol version */
unsigned char type; /* EAPOL type */
unsigned short length; /* Length of body */
unsigned char body[1]; /* Body (optional) */
} BWL_POST_PACKED_STRUCT eapol_header_t;
#define EAPOL_HEADER_LEN 18
typedef struct {
unsigned char version; /* EAPOL protocol version */
unsigned char type; /* EAPOL type */
unsigned short length; /* Length of body */
} eapol_hdr_t;
#define EAPOL_HDR_LEN 4
/* EAPOL version */
#define WPA2_EAPOL_VERSION 2
#define WPA_EAPOL_VERSION 1
#define LEAP_EAPOL_VERSION 1
#define SES_EAPOL_VERSION 1
/* EAPOL types */
#define EAP_PACKET 0
#define EAPOL_START 1
#define EAPOL_LOGOFF 2
#define EAPOL_KEY 3
#define EAPOL_ASF 4
/* EAPOL-Key types */
#define EAPOL_RC4_KEY 1
#define EAPOL_WPA2_KEY 2 /* 802.11i/WPA2 */
#define EAPOL_WPA_KEY 254 /* WPA */
/* RC4 EAPOL-Key header field sizes */
#define EAPOL_KEY_REPLAY_LEN 8
#define EAPOL_KEY_IV_LEN 16
#define EAPOL_KEY_SIG_LEN 16
/* RC4 EAPOL-Key */
typedef BWL_PRE_PACKED_STRUCT struct {
unsigned char type; /* Key Descriptor Type */
unsigned short length; /* Key Length (unaligned) */
unsigned char replay[EAPOL_KEY_REPLAY_LEN]; /* Replay Counter */
unsigned char iv[EAPOL_KEY_IV_LEN]; /* Key IV */
unsigned char index; /* Key Flags & Index */
unsigned char signature[EAPOL_KEY_SIG_LEN]; /* Key Signature */
unsigned char key[1]; /* Key (optional) */
} BWL_POST_PACKED_STRUCT eapol_key_header_t;
#define EAPOL_KEY_HEADER_LEN 44
/* RC4 EAPOL-Key flags */
#define EAPOL_KEY_FLAGS_MASK 0x80
#define EAPOL_KEY_BROADCAST 0
#define EAPOL_KEY_UNICAST 0x80
/* RC4 EAPOL-Key index */
#define EAPOL_KEY_INDEX_MASK 0x7f
/* WPA/802.11i/WPA2 EAPOL-Key header field sizes */
#define EAPOL_WPA_KEY_REPLAY_LEN 8
#define EAPOL_WPA_KEY_NONCE_LEN 32
#define EAPOL_WPA_KEY_IV_LEN 16
#define EAPOL_WPA_KEY_RSC_LEN 8
#define EAPOL_WPA_KEY_ID_LEN 8
#define EAPOL_WPA_KEY_MIC_LEN 16
#define EAPOL_WPA_KEY_DATA_LEN (EAPOL_WPA_MAX_KEY_SIZE + AKW_BLOCK_LEN)
#define EAPOL_WPA_MAX_KEY_SIZE 32
/* WPA EAPOL-Key */
typedef BWL_PRE_PACKED_STRUCT struct {
unsigned char type; /* Key Descriptor Type */
unsigned short key_info; /* Key Information (unaligned) */
unsigned short key_len; /* Key Length (unaligned) */
unsigned char replay[EAPOL_WPA_KEY_REPLAY_LEN]; /* Replay Counter */
unsigned char nonce[EAPOL_WPA_KEY_NONCE_LEN]; /* Nonce */
unsigned char iv[EAPOL_WPA_KEY_IV_LEN]; /* Key IV */
unsigned char rsc[EAPOL_WPA_KEY_RSC_LEN]; /* Key RSC */
unsigned char id[EAPOL_WPA_KEY_ID_LEN]; /* WPA:Key ID, 802.11i/WPA2: Reserved */
unsigned char mic[EAPOL_WPA_KEY_MIC_LEN]; /* Key MIC */
unsigned short data_len; /* Key Data Length */
unsigned char data[EAPOL_WPA_KEY_DATA_LEN]; /* Key data */
} BWL_POST_PACKED_STRUCT eapol_wpa_key_header_t;
#define EAPOL_WPA_KEY_LEN 95
/* WPA/802.11i/WPA2 KEY KEY_INFO bits */
#define WPA_KEY_DESC_V1 0x01
#define WPA_KEY_DESC_V2 0x02
#define WPA_KEY_DESC_V3 0x03
#define WPA_KEY_PAIRWISE 0x08
#define WPA_KEY_INSTALL 0x40
#define WPA_KEY_ACK 0x80
#define WPA_KEY_MIC 0x100
#define WPA_KEY_SECURE 0x200
#define WPA_KEY_ERROR 0x400
#define WPA_KEY_REQ 0x800
#define WPA_KEY_DESC_V2_OR_V3 WPA_KEY_DESC_V2
/* WPA-only KEY KEY_INFO bits */
#define WPA_KEY_INDEX_0 0x00
#define WPA_KEY_INDEX_1 0x10
#define WPA_KEY_INDEX_2 0x20
#define WPA_KEY_INDEX_3 0x30
#define WPA_KEY_INDEX_MASK 0x30
#define WPA_KEY_INDEX_SHIFT 0x04
/* 802.11i/WPA2-only KEY KEY_INFO bits */
#define WPA_KEY_ENCRYPTED_DATA 0x1000
/* Key Data encapsulation */
typedef BWL_PRE_PACKED_STRUCT struct {
uint8 type;
uint8 length;
uint8 oui[3];
uint8 subtype;
uint8 data[1];
} BWL_POST_PACKED_STRUCT eapol_wpa2_encap_data_t;
#define EAPOL_WPA2_ENCAP_DATA_HDR_LEN 6
#define WPA2_KEY_DATA_SUBTYPE_GTK 1
#define WPA2_KEY_DATA_SUBTYPE_STAKEY 2
#define WPA2_KEY_DATA_SUBTYPE_MAC 3
#define WPA2_KEY_DATA_SUBTYPE_PMKID 4
#define WPA2_KEY_DATA_SUBTYPE_IGTK 9
/* GTK encapsulation */
typedef BWL_PRE_PACKED_STRUCT struct {
uint8 flags;
uint8 reserved;
uint8 gtk[EAPOL_WPA_MAX_KEY_SIZE];
} BWL_POST_PACKED_STRUCT eapol_wpa2_key_gtk_encap_t;
#define EAPOL_WPA2_KEY_GTK_ENCAP_HDR_LEN 2
#define WPA2_GTK_INDEX_MASK 0x03
#define WPA2_GTK_INDEX_SHIFT 0x00
#define WPA2_GTK_TRANSMIT 0x04
/* IGTK encapsulation */
typedef BWL_PRE_PACKED_STRUCT struct {
uint16 key_id;
uint8 ipn[6];
uint8 key[EAPOL_WPA_MAX_KEY_SIZE];
} BWL_POST_PACKED_STRUCT eapol_wpa2_key_igtk_encap_t;
#define EAPOL_WPA2_KEY_IGTK_ENCAP_HDR_LEN 8
/* STAKey encapsulation */
typedef BWL_PRE_PACKED_STRUCT struct {
uint8 reserved[2];
uint8 mac[ETHER_ADDR_LEN];
uint8 stakey[EAPOL_WPA_MAX_KEY_SIZE];
} BWL_POST_PACKED_STRUCT eapol_wpa2_key_stakey_encap_t;
#define WPA2_KEY_DATA_PAD 0xdd
/* This marks the end of a packed structure section. */
#include <packed_section_end.h>
#endif /* _eapol_h_ */

View File

@@ -0,0 +1,162 @@
/*
* From FreeBSD 2.2.7: Fundamental constants relating to ethernet.
*
* Copyright (C) 1999-2012, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* under the terms of the GNU General Public License version 2 (the "GPL"),
* available at http://www.broadcom.com/licenses/GPLv2.php, with the
* following added to such license:
*
* As a special exception, the copyright holders of this software give you
* permission to link this software with independent modules, and to copy and
* distribute the resulting executable under terms of your choice, provided that
* you also meet, for each linked independent module, the terms and conditions of
* the license of that module. An independent module is a module which is not
* derived from this software. The special exception does not apply to any
* modifications of the software.
*
* Notwithstanding the above, under no circumstances may you combine this
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
* $Id: ethernet.h 309193 2012-01-19 00:03:57Z $
*/
#ifndef _NET_ETHERNET_H_
#define _NET_ETHERNET_H_
#ifndef _TYPEDEFS_H_
#include "typedefs.h"
#endif
#include <packed_section_start.h>
#define ETHER_ADDR_LEN 6
#define ETHER_TYPE_LEN 2
#define ETHER_CRC_LEN 4
#define ETHER_HDR_LEN (ETHER_ADDR_LEN * 2 + ETHER_TYPE_LEN)
#define ETHER_MIN_LEN 64
#define ETHER_MIN_DATA 46
#define ETHER_MAX_LEN 1518
#define ETHER_MAX_DATA 1500
#define ETHER_TYPE_MIN 0x0600
#define ETHER_TYPE_IP 0x0800
#define ETHER_TYPE_ARP 0x0806
#define ETHER_TYPE_8021Q 0x8100
#define ETHER_TYPE_IPV6 0x86dd
#define ETHER_TYPE_BRCM 0x886c
#define ETHER_TYPE_802_1X 0x888e
#define ETHER_TYPE_802_1X_PREAUTH 0x88c7
#define ETHER_TYPE_WAI 0x88b4
#define ETHER_TYPE_89_0D 0x890d
#define ETHER_TYPE_IPV6 0x86dd
#define ETHER_BRCM_SUBTYPE_LEN 4
#define ETHER_DEST_OFFSET (0 * ETHER_ADDR_LEN)
#define ETHER_SRC_OFFSET (1 * ETHER_ADDR_LEN)
#define ETHER_TYPE_OFFSET (2 * ETHER_ADDR_LEN)
#define ETHER_IS_VALID_LEN(foo) \
((foo) >= ETHER_MIN_LEN && (foo) <= ETHER_MAX_LEN)
#define ETHER_FILL_MCAST_ADDR_FROM_IP(ea, mgrp_ip) { \
((uint8 *)ea)[0] = 0x01; \
((uint8 *)ea)[1] = 0x00; \
((uint8 *)ea)[2] = 0x5e; \
((uint8 *)ea)[3] = ((mgrp_ip) >> 16) & 0x7f; \
((uint8 *)ea)[4] = ((mgrp_ip) >> 8) & 0xff; \
((uint8 *)ea)[5] = ((mgrp_ip) >> 0) & 0xff; \
}
#ifndef __INCif_etherh
BWL_PRE_PACKED_STRUCT struct ether_header {
uint8 ether_dhost[ETHER_ADDR_LEN];
uint8 ether_shost[ETHER_ADDR_LEN];
uint16 ether_type;
} BWL_POST_PACKED_STRUCT;
BWL_PRE_PACKED_STRUCT struct ether_addr {
uint8 octet[ETHER_ADDR_LEN];
} BWL_POST_PACKED_STRUCT;
#endif
#define ETHER_SET_LOCALADDR(ea) (((uint8 *)(ea))[0] = (((uint8 *)(ea))[0] | 2))
#define ETHER_IS_LOCALADDR(ea) (((uint8 *)(ea))[0] & 2)
#define ETHER_CLR_LOCALADDR(ea) (((uint8 *)(ea))[0] = (((uint8 *)(ea))[0] & 0xfd))
#define ETHER_TOGGLE_LOCALADDR(ea) (((uint8 *)(ea))[0] = (((uint8 *)(ea))[0] ^ 2))
#define ETHER_SET_UNICAST(ea) (((uint8 *)(ea))[0] = (((uint8 *)(ea))[0] & ~1))
#define ETHER_ISMULTI(ea) (((const uint8 *)(ea))[0] & 1)
#define ether_cmp(a, b) (!(((short*)(a))[0] == ((short*)(b))[0]) | \
!(((short*)(a))[1] == ((short*)(b))[1]) | \
!(((short*)(a))[2] == ((short*)(b))[2]))
#define ether_copy(s, d) { \
((short*)(d))[0] = ((const short*)(s))[0]; \
((short*)(d))[1] = ((const short*)(s))[1]; \
((short*)(d))[2] = ((const short*)(s))[2]; }
static const struct ether_addr ether_bcast = {{255, 255, 255, 255, 255, 255}};
static const struct ether_addr ether_null = {{0, 0, 0, 0, 0, 0}};
#define ETHER_ISBCAST(ea) ((((uint8 *)(ea))[0] & \
((uint8 *)(ea))[1] & \
((uint8 *)(ea))[2] & \
((uint8 *)(ea))[3] & \
((uint8 *)(ea))[4] & \
((uint8 *)(ea))[5]) == 0xff)
#define ETHER_ISNULLADDR(ea) ((((uint8 *)(ea))[0] | \
((uint8 *)(ea))[1] | \
((uint8 *)(ea))[2] | \
((uint8 *)(ea))[3] | \
((uint8 *)(ea))[4] | \
((uint8 *)(ea))[5]) == 0)
#define ETHER_MOVE_HDR(d, s) \
do { \
struct ether_header t; \
t = *(struct ether_header *)(s); \
*(struct ether_header *)(d) = t; \
} while (0)
#include <packed_section_end.h>
#endif

View File

@@ -0,0 +1,564 @@
/*
* Copyright (C) 1999-2012, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* under the terms of the GNU General Public License version 2 (the "GPL"),
* available at http://www.broadcom.com/licenses/GPLv2.php, with the
* following added to such license:
*
* As a special exception, the copyright holders of this software give you
* permission to link this software with independent modules, and to copy and
* distribute the resulting executable under terms of your choice, provided that
* you also meet, for each linked independent module, the terms and conditions of
* the license of that module. An independent module is a module which is not
* derived from this software. The special exception does not apply to any
* modifications of the software.
*
* Notwithstanding the above, under no circumstances may you combine this
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
* Fundamental types and constants relating to WFA P2P (aka WiFi Direct)
*
* $Id: p2p.h 326276 2012-04-06 23:16:42Z $
*/
#ifndef _P2P_H_
#define _P2P_H_
#ifndef _TYPEDEFS_H_
#include <typedefs.h>
#endif
#include <wlioctl.h>
#include <proto/802.11.h>
#include <packed_section_start.h>
#define P2P_OUI WFA_OUI
#define P2P_VER WFA_OUI_TYPE_P2P
#define P2P_IE_ID 0xdd
BWL_PRE_PACKED_STRUCT struct wifi_p2p_ie {
uint8 id;
uint8 len;
uint8 OUI[3];
uint8 oui_type;
uint8 subelts[1];
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2p_ie wifi_p2p_ie_t;
#define P2P_IE_FIXED_LEN 6
#define P2P_ATTR_ID_OFF 0
#define P2P_ATTR_LEN_OFF 1
#define P2P_ATTR_DATA_OFF 3
#define P2P_ATTR_ID_LEN 1
#define P2P_ATTR_LEN_LEN 2
#define P2P_ATTR_HDR_LEN 3
#define P2P_SEID_STATUS 0
#define P2P_SEID_MINOR_RC 1
#define P2P_SEID_P2P_INFO 2
#define P2P_SEID_DEV_ID 3
#define P2P_SEID_INTENT 4
#define P2P_SEID_CFG_TIMEOUT 5
#define P2P_SEID_CHANNEL 6
#define P2P_SEID_GRP_BSSID 7
#define P2P_SEID_XT_TIMING 8
#define P2P_SEID_INTINTADDR 9
#define P2P_SEID_P2P_MGBTY 10
#define P2P_SEID_CHAN_LIST 11
#define P2P_SEID_ABSENCE 12
#define P2P_SEID_DEV_INFO 13
#define P2P_SEID_GROUP_INFO 14
#define P2P_SEID_GROUP_ID 15
#define P2P_SEID_P2P_IF 16
#define P2P_SEID_OP_CHANNEL 17
#define P2P_SEID_INVITE_FLAGS 18
#define P2P_SEID_VNDR 221
#define P2P_SE_VS_ID_SERVICES 0x1b
BWL_PRE_PACKED_STRUCT struct wifi_p2p_info_se_s {
uint8 eltId;
uint8 len[2];
uint8 dev;
uint8 group;
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2p_info_se_s wifi_p2p_info_se_t;
#define P2P_CAPSE_DEV_SERVICE_DIS 0x1
#define P2P_CAPSE_DEV_CLIENT_DIS 0x2
#define P2P_CAPSE_DEV_CONCURRENT 0x4
#define P2P_CAPSE_DEV_INFRA_MAN 0x8
#define P2P_CAPSE_DEV_LIMIT 0x10
#define P2P_CAPSE_INVITE_PROC 0x20
#define P2P_CAPSE_GRP_OWNER 0x1
#define P2P_CAPSE_PERSIST_GRP 0x2
#define P2P_CAPSE_GRP_LIMIT 0x4
#define P2P_CAPSE_GRP_INTRA_BSS 0x8
#define P2P_CAPSE_GRP_X_CONNECT 0x10
#define P2P_CAPSE_GRP_PERSISTENT 0x20
#define P2P_CAPSE_GRP_FORMATION 0x40
BWL_PRE_PACKED_STRUCT struct wifi_p2p_intent_se_s {
uint8 eltId;
uint8 len[2];
uint8 intent;
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2p_intent_se_s wifi_p2p_intent_se_t;
BWL_PRE_PACKED_STRUCT struct wifi_p2p_cfg_tmo_se_s {
uint8 eltId;
uint8 len[2];
uint8 go_tmo;
uint8 client_tmo;
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2p_cfg_tmo_se_s wifi_p2p_cfg_tmo_se_t;
BWL_PRE_PACKED_STRUCT struct wifi_p2p_listen_channel_se_s {
uint8 eltId;
uint8 len[2];
uint8 country[3];
uint8 op_class;
uint8 channel;
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2p_listen_channel_se_s wifi_p2p_listen_channel_se_t;
BWL_PRE_PACKED_STRUCT struct wifi_p2p_grp_bssid_se_s {
uint8 eltId;
uint8 len[2];
uint8 mac[6];
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2p_grp_bssid_se_s wifi_p2p_grp_bssid_se_t;
BWL_PRE_PACKED_STRUCT struct wifi_p2p_grp_id_se_s {
uint8 eltId;
uint8 len[2];
uint8 mac[6];
uint8 ssid[1];
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2p_grp_id_se_s wifi_p2p_grp_id_se_t;
BWL_PRE_PACKED_STRUCT struct wifi_p2p_intf_se_s {
uint8 eltId;
uint8 len[2];
uint8 mac[6];
uint8 ifaddrs;
uint8 ifaddr[1][6];
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2p_intf_se_s wifi_p2p_intf_se_t;
BWL_PRE_PACKED_STRUCT struct wifi_p2p_status_se_s {
uint8 eltId;
uint8 len[2];
uint8 status;
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2p_status_se_s wifi_p2p_status_se_t;
#define P2P_STATSE_SUCCESS 0
#define P2P_STATSE_FAIL_INFO_CURR_UNAVAIL 1
#define P2P_STATSE_PASSED_UP P2P_STATSE_FAIL_INFO_CURR_UNAVAIL
#define P2P_STATSE_FAIL_INCOMPAT_PARAMS 2
#define P2P_STATSE_FAIL_LIMIT_REACHED 3
#define P2P_STATSE_FAIL_INVALID_PARAMS 4
#define P2P_STATSE_FAIL_UNABLE_TO_ACCOM 5
#define P2P_STATSE_FAIL_PROTO_ERROR 6
#define P2P_STATSE_FAIL_NO_COMMON_CHAN 7
#define P2P_STATSE_FAIL_UNKNOWN_GROUP 8
#define P2P_STATSE_FAIL_INTENT 9
#define P2P_STATSE_FAIL_INCOMPAT_PROVIS 10
#define P2P_STATSE_FAIL_USER_REJECT 11
BWL_PRE_PACKED_STRUCT struct wifi_p2p_ext_se_s {
uint8 eltId;
uint8 len[2];
uint8 avail[2];
uint8 interval[2];
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2p_ext_se_s wifi_p2p_ext_se_t;
#define P2P_EXT_MIN 10
BWL_PRE_PACKED_STRUCT struct wifi_p2p_intintad_se_s {
uint8 eltId;
uint8 len[2];
uint8 mac[6];
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2p_intintad_se_s wifi_p2p_intintad_se_t;
BWL_PRE_PACKED_STRUCT struct wifi_p2p_channel_se_s {
uint8 eltId;
uint8 len[2];
uint8 band;
uint8 channel;
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2p_channel_se_s wifi_p2p_channel_se_t;
BWL_PRE_PACKED_STRUCT struct wifi_p2p_chanlist_entry_s {
uint8 band;
uint8 num_channels;
uint8 channels[WL_NUMCHANNELS];
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2p_chanlist_entry_s wifi_p2p_chanlist_entry_t;
#define WIFI_P2P_CHANLIST_SE_MAX_ENTRIES 2
BWL_PRE_PACKED_STRUCT struct wifi_p2p_chanlist_se_s {
uint8 eltId;
uint8 len[2];
uint8 country[3];
uint8 num_entries;
wifi_p2p_chanlist_entry_t entries[WIFI_P2P_CHANLIST_SE_MAX_ENTRIES];
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2p_chanlist_se_s wifi_p2p_chanlist_se_t;
BWL_PRE_PACKED_STRUCT struct wifi_p2p_pri_devtype_s {
uint16 cat_id;
uint8 OUI[3];
uint8 oui_type;
uint16 sub_cat_id;
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2p_pri_devtype_s wifi_p2p_pri_devtype_t;
BWL_PRE_PACKED_STRUCT struct wifi_p2p_devinfo_se_s {
uint8 eltId;
uint8 len[2];
uint8 mac[6];
uint16 wps_cfg_meths;
uint8 pri_devtype[8];
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2p_devinfo_se_s wifi_p2p_devinfo_se_t;
#define P2P_DEV_TYPE_LEN 8
BWL_PRE_PACKED_STRUCT struct wifi_p2p_cid_fixed_s {
uint8 len;
uint8 devaddr[ETHER_ADDR_LEN];
uint8 ifaddr[ETHER_ADDR_LEN];
uint8 devcap;
uint8 cfg_meths[2];
uint8 pridt[P2P_DEV_TYPE_LEN];
uint8 secdts;
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2p_cid_fixed_s wifi_p2p_cid_fixed_t;
BWL_PRE_PACKED_STRUCT struct wifi_p2p_devid_se_s {
uint8 eltId;
uint8 len[2];
struct ether_addr addr;
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2p_devid_se_s wifi_p2p_devid_se_t;
BWL_PRE_PACKED_STRUCT struct wifi_p2p_mgbt_se_s {
uint8 eltId;
uint8 len[2];
uint8 mg_bitmap;
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2p_mgbt_se_s wifi_p2p_mgbt_se_t;
#define P2P_MGBTSE_P2PDEVMGMT_FLAG 0x1
BWL_PRE_PACKED_STRUCT struct wifi_p2p_grpinfo_se_s {
uint8 eltId;
uint8 len[2];
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2p_grpinfo_se_s wifi_p2p_grpinfo_se_t;
BWL_PRE_PACKED_STRUCT struct wifi_p2p_op_channel_se_s {
uint8 eltId;
uint8 len[2];
uint8 country[3];
uint8 op_class;
uint8 channel;
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2p_op_channel_se_s wifi_p2p_op_channel_se_t;
BWL_PRE_PACKED_STRUCT struct wifi_p2p_invite_flags_se_s {
uint8 eltId;
uint8 len[2];
uint8 flags;
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2p_invite_flags_se_s wifi_p2p_invite_flags_se_t;
BWL_PRE_PACKED_STRUCT struct wifi_p2p_action_frame {
uint8 category;
uint8 OUI[3];
uint8 type;
uint8 subtype;
uint8 dialog_token;
uint8 elts[1];
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2p_action_frame wifi_p2p_action_frame_t;
#define P2P_AF_CATEGORY 0x7f
#define P2P_AF_FIXED_LEN 7
#define P2P_AF_NOTICE_OF_ABSENCE 0
#define P2P_AF_PRESENCE_REQ 1
#define P2P_AF_PRESENCE_RSP 2
#define P2P_AF_GO_DISC_REQ 3
BWL_PRE_PACKED_STRUCT struct wifi_p2p_pub_act_frame {
uint8 category;
uint8 action;
uint8 oui[3];
uint8 oui_type;
uint8 subtype;
uint8 dialog_token;
uint8 elts[1];
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2p_pub_act_frame wifi_p2p_pub_act_frame_t;
#define P2P_PUB_AF_FIXED_LEN 8
#define P2P_PUB_AF_CATEGORY 0x04
#define P2P_PUB_AF_ACTION 0x09
#define P2P_PAF_GON_REQ 0
#define P2P_PAF_GON_RSP 1
#define P2P_PAF_GON_CONF 2
#define P2P_PAF_INVITE_REQ 3
#define P2P_PAF_INVITE_RSP 4
#define P2P_PAF_DEVDIS_REQ 5
#define P2P_PAF_DEVDIS_RSP 6
#define P2P_PAF_PROVDIS_REQ 7
#define P2P_PAF_PROVDIS_RSP 8
#define P2P_TYPE_MNREQ P2P_PAF_GON_REQ
#define P2P_TYPE_MNRSP P2P_PAF_GON_RSP
#define P2P_TYPE_MNCONF P2P_PAF_GON_CONF
BWL_PRE_PACKED_STRUCT struct wifi_p2p_noa_desc {
uint8 cnt_type;
uint32 duration;
uint32 interval;
uint32 start;
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2p_noa_desc wifi_p2p_noa_desc_t;
BWL_PRE_PACKED_STRUCT struct wifi_p2p_noa_se {
uint8 eltId;
uint8 len[2];
uint8 index;
uint8 ops_ctw_parms;
wifi_p2p_noa_desc_t desc[1];
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2p_noa_se wifi_p2p_noa_se_t;
#define P2P_NOA_SE_FIXED_LEN 5
#define P2P_NOA_DESC_CNT_RESERVED 0
#define P2P_NOA_DESC_CNT_REPEAT 255
#define P2P_NOA_DESC_TYPE_PREFERRED 1
#define P2P_NOA_DESC_TYPE_ACCEPTABLE 2
#define P2P_NOA_CTW_MASK 0x7f
#define P2P_NOA_OPS_MASK 0x80
#define P2P_NOA_OPS_SHIFT 7
#define P2P_CTW_MIN 10
#define P2PSD_ACTION_CATEGORY 0x04
#define P2PSD_ACTION_ID_GAS_IREQ 0x0a
#define P2PSD_ACTION_ID_GAS_IRESP 0x0b
#define P2PSD_ACTION_ID_GAS_CREQ 0x0c
#define P2PSD_ACTION_ID_GAS_CRESP 0x0d
#define P2PSD_AD_EID 0x6c
#define P2PSD_ADP_TUPLE_QLMT_PAMEBI 0x00
#define P2PSD_ADP_PROTO_ID 0x00
#define P2PSD_GAS_OUI P2P_OUI
#define P2PSD_GAS_OUI_SUBTYPE P2P_VER
#define P2PSD_GAS_NQP_INFOID 0xDDDD
#define P2PSD_GAS_COMEBACKDEALY 0x00
typedef enum p2psd_svc_protype {
SVC_RPOTYPE_ALL = 0,
SVC_RPOTYPE_BONJOUR = 1,
SVC_RPOTYPE_UPNP = 2,
SVC_RPOTYPE_WSD = 3,
SVC_RPOTYPE_VENDOR = 255
} p2psd_svc_protype_t;
typedef enum {
P2PSD_RESP_STATUS_SUCCESS = 0,
P2PSD_RESP_STATUS_PROTYPE_NA = 1,
P2PSD_RESP_STATUS_DATA_NA = 2,
P2PSD_RESP_STATUS_BAD_REQUEST = 3
} p2psd_resp_status_t;
BWL_PRE_PACKED_STRUCT struct wifi_p2psd_adp_tpl {
uint8 llm_pamebi;
uint8 adp_id;
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2psd_adp_tpl wifi_p2psd_adp_tpl_t;
BWL_PRE_PACKED_STRUCT struct wifi_p2psd_adp_ie {
uint8 id;
uint8 len;
wifi_p2psd_adp_tpl_t adp_tpl;
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2psd_adp_ie wifi_p2psd_adp_ie_t;
BWL_PRE_PACKED_STRUCT struct wifi_p2psd_nqp_query_vsc {
uint8 oui_subtype;
uint16 svc_updi;
uint8 svc_tlvs[1];
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2psd_nqp_query_vsc wifi_p2psd_nqp_query_vsc_t;
BWL_PRE_PACKED_STRUCT struct wifi_p2psd_qreq_tlv {
uint16 len;
uint8 svc_prot;
uint8 svc_tscid;
uint8 query_data[1];
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2psd_qreq_tlv wifi_p2psd_qreq_tlv_t;
BWL_PRE_PACKED_STRUCT struct wifi_p2psd_qreq_frame {
uint16 info_id;
uint16 len;
uint8 oui[3];
uint8 qreq_vsc[1];
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2psd_qreq_frame wifi_p2psd_qreq_frame_t;
BWL_PRE_PACKED_STRUCT struct wifi_p2psd_gas_ireq_frame {
wifi_p2psd_adp_ie_t adp_ie;
uint16 qreq_len;
uint8 qreq_frm[1];
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2psd_gas_ireq_frame wifi_p2psd_gas_ireq_frame_t;
BWL_PRE_PACKED_STRUCT struct wifi_p2psd_qresp_tlv {
uint16 len;
uint8 svc_prot;
uint8 svc_tscid;
uint8 status;
uint8 query_data[1];
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2psd_qresp_tlv wifi_p2psd_qresp_tlv_t;
BWL_PRE_PACKED_STRUCT struct wifi_p2psd_qresp_frame {
uint16 info_id;
uint16 len;
uint8 oui[3];
uint8 qresp_vsc[1];
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2psd_qresp_frame wifi_p2psd_qresp_frame_t;
BWL_PRE_PACKED_STRUCT struct wifi_p2psd_gas_iresp_frame {
uint16 status;
uint16 cb_delay;
wifi_p2psd_adp_ie_t adp_ie;
uint16 qresp_len;
uint8 qresp_frm[1];
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2psd_gas_iresp_frame wifi_p2psd_gas_iresp_frame_t;
BWL_PRE_PACKED_STRUCT struct wifi_p2psd_gas_cresp_frame {
uint16 status;
uint8 fragment_id;
uint16 cb_delay;
wifi_p2psd_adp_ie_t adp_ie;
uint16 qresp_len;
uint8 qresp_frm[1];
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2psd_gas_cresp_frame wifi_p2psd_gas_cresp_frame_t;
BWL_PRE_PACKED_STRUCT struct wifi_p2psd_gas_pub_act_frame {
uint8 category;
uint8 action;
uint8 dialog_token;
uint8 query_data[1];
} BWL_POST_PACKED_STRUCT;
typedef struct wifi_p2psd_gas_pub_act_frame wifi_p2psd_gas_pub_act_frame_t;
#include <packed_section_end.h>
#endif

View File

@@ -0,0 +1,75 @@
/*
* SD-SPI Protocol Standard
*
* Copyright (C) 1999-2012, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* under the terms of the GNU General Public License version 2 (the "GPL"),
* available at http://www.broadcom.com/licenses/GPLv2.php, with the
* following added to such license:
*
* As a special exception, the copyright holders of this software give you
* permission to link this software with independent modules, and to copy and
* distribute the resulting executable under terms of your choice, provided that
* you also meet, for each linked independent module, the terms and conditions of
* the license of that module. An independent module is a module which is not
* derived from this software. The special exception does not apply to any
* modifications of the software.
*
* Notwithstanding the above, under no circumstances may you combine this
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
* $Id: sdspi.h 241182 2011-02-17 21:50:03Z $
*/
#ifndef _SD_SPI_H
#define _SD_SPI_H
#define SPI_START_M BITFIELD_MASK(1) /* Bit [31] - Start Bit */
#define SPI_START_S 31
#define SPI_DIR_M BITFIELD_MASK(1) /* Bit [30] - Direction */
#define SPI_DIR_S 30
#define SPI_CMD_INDEX_M BITFIELD_MASK(6) /* Bits [29:24] - Command number */
#define SPI_CMD_INDEX_S 24
#define SPI_RW_M BITFIELD_MASK(1) /* Bit [23] - Read=0, Write=1 */
#define SPI_RW_S 23
#define SPI_FUNC_M BITFIELD_MASK(3) /* Bits [22:20] - Function Number */
#define SPI_FUNC_S 20
#define SPI_RAW_M BITFIELD_MASK(1) /* Bit [19] - Read After Wr */
#define SPI_RAW_S 19
#define SPI_STUFF_M BITFIELD_MASK(1) /* Bit [18] - Stuff bit */
#define SPI_STUFF_S 18
#define SPI_BLKMODE_M BITFIELD_MASK(1) /* Bit [19] - Blockmode 1=blk */
#define SPI_BLKMODE_S 19
#define SPI_OPCODE_M BITFIELD_MASK(1) /* Bit [18] - OP Code */
#define SPI_OPCODE_S 18
#define SPI_ADDR_M BITFIELD_MASK(17) /* Bits [17:1] - Address */
#define SPI_ADDR_S 1
#define SPI_STUFF0_M BITFIELD_MASK(1) /* Bit [0] - Stuff bit */
#define SPI_STUFF0_S 0
#define SPI_RSP_START_M BITFIELD_MASK(1) /* Bit [7] - Start Bit (always 0) */
#define SPI_RSP_START_S 7
#define SPI_RSP_PARAM_ERR_M BITFIELD_MASK(1) /* Bit [6] - Parameter Error */
#define SPI_RSP_PARAM_ERR_S 6
#define SPI_RSP_RFU5_M BITFIELD_MASK(1) /* Bit [5] - RFU (Always 0) */
#define SPI_RSP_RFU5_S 5
#define SPI_RSP_FUNC_ERR_M BITFIELD_MASK(1) /* Bit [4] - Function number error */
#define SPI_RSP_FUNC_ERR_S 4
#define SPI_RSP_CRC_ERR_M BITFIELD_MASK(1) /* Bit [3] - COM CRC Error */
#define SPI_RSP_CRC_ERR_S 3
#define SPI_RSP_ILL_CMD_M BITFIELD_MASK(1) /* Bit [2] - Illegal Command error */
#define SPI_RSP_ILL_CMD_S 2
#define SPI_RSP_RFU1_M BITFIELD_MASK(1) /* Bit [1] - RFU (Always 0) */
#define SPI_RSP_RFU1_S 1
#define SPI_RSP_IDLE_M BITFIELD_MASK(1) /* Bit [0] - In idle state */
#define SPI_RSP_IDLE_S 0
/* SD-SPI Protocol Definitions */
#define SDSPI_COMMAND_LEN 6 /* Number of bytes in an SD command */
#define SDSPI_START_BLOCK 0xFE /* SD Start Block Token */
#define SDSPI_IDLE_PAD 0xFF /* SD-SPI idle value for MOSI */
#define SDSPI_START_BIT_MASK 0x80
#endif /* _SD_SPI_H */

View File

@@ -0,0 +1,69 @@
/*
* 802.1Q VLAN protocol definitions
*
* Copyright (C) 1999-2012, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* under the terms of the GNU General Public License version 2 (the "GPL"),
* available at http://www.broadcom.com/licenses/GPLv2.php, with the
* following added to such license:
*
* As a special exception, the copyright holders of this software give you
* permission to link this software with independent modules, and to copy and
* distribute the resulting executable under terms of your choice, provided that
* you also meet, for each linked independent module, the terms and conditions of
* the license of that module. An independent module is a module which is not
* derived from this software. The special exception does not apply to any
* modifications of the software.
*
* Notwithstanding the above, under no circumstances may you combine this
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
* $Id: vlan.h 241182 2011-02-17 21:50:03Z $
*/
#ifndef _vlan_h_
#define _vlan_h_
#ifndef _TYPEDEFS_H_
#include <typedefs.h>
#endif
#include <packed_section_start.h>
#define VLAN_VID_MASK 0xfff
#define VLAN_CFI_SHIFT 12
#define VLAN_PRI_SHIFT 13
#define VLAN_PRI_MASK 7
#define VLAN_TAG_LEN 4
#define VLAN_TAG_OFFSET (2 * ETHER_ADDR_LEN)
#define VLAN_TPID 0x8100
struct ethervlan_header {
uint8 ether_dhost[ETHER_ADDR_LEN];
uint8 ether_shost[ETHER_ADDR_LEN];
uint16 vlan_type;
uint16 vlan_tag;
uint16 ether_type;
};
#define ETHERVLAN_HDR_LEN (ETHER_HDR_LEN + VLAN_TAG_LEN)
#include <packed_section_end.h>
#define ETHERVLAN_MOVE_HDR(d, s) \
do { \
struct ethervlan_header t; \
t = *(struct ethervlan_header *)(s); \
*(struct ethervlan_header *)(d) = t; \
} while (0)
#endif

View File

@@ -0,0 +1,203 @@
/*
* Fundamental types and constants relating to WPA
*
* Copyright (C) 1999-2012, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* under the terms of the GNU General Public License version 2 (the "GPL"),
* available at http://www.broadcom.com/licenses/GPLv2.php, with the
* following added to such license:
*
* As a special exception, the copyright holders of this software give you
* permission to link this software with independent modules, and to copy and
* distribute the resulting executable under terms of your choice, provided that
* you also meet, for each linked independent module, the terms and conditions of
* the license of that module. An independent module is a module which is not
* derived from this software. The special exception does not apply to any
* modifications of the software.
*
* Notwithstanding the above, under no circumstances may you combine this
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
* $Id: wpa.h 261155 2011-05-23 23:51:32Z $
*/
#ifndef _proto_wpa_h_
#define _proto_wpa_h_
#include <typedefs.h>
#include <proto/ethernet.h>
#include <packed_section_start.h>
#define DOT11_RC_INVALID_WPA_IE 13
#define DOT11_RC_MIC_FAILURE 14
#define DOT11_RC_4WH_TIMEOUT 15
#define DOT11_RC_GTK_UPDATE_TIMEOUT 16
#define DOT11_RC_WPA_IE_MISMATCH 17
#define DOT11_RC_INVALID_MC_CIPHER 18
#define DOT11_RC_INVALID_UC_CIPHER 19
#define DOT11_RC_INVALID_AKMP 20
#define DOT11_RC_BAD_WPA_VERSION 21
#define DOT11_RC_INVALID_WPA_CAP 22
#define DOT11_RC_8021X_AUTH_FAIL 23
#define WPA2_PMKID_LEN 16
typedef BWL_PRE_PACKED_STRUCT struct
{
uint8 tag;
uint8 length;
uint8 oui[3];
uint8 oui_type;
BWL_PRE_PACKED_STRUCT struct {
uint8 low;
uint8 high;
} BWL_POST_PACKED_STRUCT version;
} BWL_POST_PACKED_STRUCT wpa_ie_fixed_t;
#define WPA_IE_OUITYPE_LEN 4
#define WPA_IE_FIXED_LEN 8
#define WPA_IE_TAG_FIXED_LEN 6
typedef BWL_PRE_PACKED_STRUCT struct {
uint8 tag;
uint8 length;
BWL_PRE_PACKED_STRUCT struct {
uint8 low;
uint8 high;
} BWL_POST_PACKED_STRUCT version;
} BWL_POST_PACKED_STRUCT wpa_rsn_ie_fixed_t;
#define WPA_RSN_IE_FIXED_LEN 4
#define WPA_RSN_IE_TAG_FIXED_LEN 2
typedef uint8 wpa_pmkid_t[WPA2_PMKID_LEN];
typedef BWL_PRE_PACKED_STRUCT struct
{
uint8 oui[3];
uint8 type;
} BWL_POST_PACKED_STRUCT wpa_suite_t, wpa_suite_mcast_t;
#define WPA_SUITE_LEN 4
typedef BWL_PRE_PACKED_STRUCT struct
{
BWL_PRE_PACKED_STRUCT struct {
uint8 low;
uint8 high;
} BWL_POST_PACKED_STRUCT count;
wpa_suite_t list[1];
} BWL_POST_PACKED_STRUCT wpa_suite_ucast_t, wpa_suite_auth_key_mgmt_t;
#define WPA_IE_SUITE_COUNT_LEN 2
typedef BWL_PRE_PACKED_STRUCT struct
{
BWL_PRE_PACKED_STRUCT struct {
uint8 low;
uint8 high;
} BWL_POST_PACKED_STRUCT count;
wpa_pmkid_t list[1];
} BWL_POST_PACKED_STRUCT wpa_pmkid_list_t;
#define WPA_CIPHER_NONE 0
#define WPA_CIPHER_WEP_40 1
#define WPA_CIPHER_TKIP 2
#define WPA_CIPHER_AES_OCB 3
#define WPA_CIPHER_AES_CCM 4
#define WPA_CIPHER_WEP_104 5
#define WPA_CIPHER_BIP 6
#define WPA_CIPHER_TPK 7
#ifdef BCMWAPI_WAI
#define WAPI_CIPHER_NONE WPA_CIPHER_NONE
#define WAPI_CIPHER_SMS4 11
#define WAPI_CSE_WPI_SMS4 1
#endif
#define IS_WPA_CIPHER(cipher) ((cipher) == WPA_CIPHER_NONE || \
(cipher) == WPA_CIPHER_WEP_40 || \
(cipher) == WPA_CIPHER_WEP_104 || \
(cipher) == WPA_CIPHER_TKIP || \
(cipher) == WPA_CIPHER_AES_OCB || \
(cipher) == WPA_CIPHER_AES_CCM || \
(cipher) == WPA_CIPHER_TPK)
#ifdef BCMWAPI_WAI
#define IS_WAPI_CIPHER(cipher) ((cipher) == WAPI_CIPHER_NONE || \
(cipher) == WAPI_CSE_WPI_SMS4)
#define WAPI_CSE_WPI_2_CIPHER(cse) ((cse) == WAPI_CSE_WPI_SMS4 ? \
WAPI_CIPHER_SMS4 : WAPI_CIPHER_NONE)
#define WAPI_CIPHER_2_CSE_WPI(cipher) ((cipher) == WAPI_CIPHER_SMS4 ? \
WAPI_CSE_WPI_SMS4 : WAPI_CIPHER_NONE)
#endif
#define WPA_TKIP_CM_DETECT 60
#define WPA_TKIP_CM_BLOCK 60
#define RSN_CAP_LEN 2
#define RSN_CAP_PREAUTH 0x0001
#define RSN_CAP_NOPAIRWISE 0x0002
#define RSN_CAP_PTK_REPLAY_CNTR_MASK 0x000C
#define RSN_CAP_PTK_REPLAY_CNTR_SHIFT 2
#define RSN_CAP_GTK_REPLAY_CNTR_MASK 0x0030
#define RSN_CAP_GTK_REPLAY_CNTR_SHIFT 4
#define RSN_CAP_1_REPLAY_CNTR 0
#define RSN_CAP_2_REPLAY_CNTRS 1
#define RSN_CAP_4_REPLAY_CNTRS 2
#define RSN_CAP_16_REPLAY_CNTRS 3
#ifdef MFP
#define RSN_CAP_MFPR 0x0040
#define RSN_CAP_MFPC 0x0080
#endif
#define WPA_CAP_4_REPLAY_CNTRS RSN_CAP_4_REPLAY_CNTRS
#define WPA_CAP_16_REPLAY_CNTRS RSN_CAP_16_REPLAY_CNTRS
#define WPA_CAP_REPLAY_CNTR_SHIFT RSN_CAP_PTK_REPLAY_CNTR_SHIFT
#define WPA_CAP_REPLAY_CNTR_MASK RSN_CAP_PTK_REPLAY_CNTR_MASK
#define WPA_CAP_PEER_KEY_ENABLE (0x1 << 1)
#define WPA_CAP_LEN RSN_CAP_LEN
#define WPA_PMKID_CNT_LEN 2
#define WPA_CAP_WPA2_PREAUTH RSN_CAP_PREAUTH
#define WPA2_PMKID_COUNT_LEN 2
#ifdef BCMWAPI_WAI
#define WAPI_CAP_PREAUTH RSN_CAP_PREAUTH
#define WAPI_WAI_REQUEST 0x00F1
#define WAPI_UNICAST_REKEY 0x00F2
#define WAPI_STA_AGING 0x00F3
#define WAPI_MUTIL_REKEY 0x00F4
#define WAPI_STA_STATS 0x00F5
#define WAPI_USK_REKEY_COUNT 0x4000000
#define WAPI_MSK_REKEY_COUNT 0x4000000
#endif
#include <packed_section_end.h>
#endif

View File

@@ -0,0 +1,379 @@
/*
* WPS IE definitions
*
* Copyright (C) 1999-2012, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* under the terms of the GNU General Public License version 2 (the "GPL"),
* available at http://www.broadcom.com/licenses/GPLv2.php, with the
* following added to such license:
*
* As a special exception, the copyright holders of this software give you
* permission to link this software with independent modules, and to copy and
* distribute the resulting executable under terms of your choice, provided that
* you also meet, for each linked independent module, the terms and conditions of
* the license of that module. An independent module is a module which is not
* derived from this software. The special exception does not apply to any
* modifications of the software.
*
* Notwithstanding the above, under no circumstances may you combine this
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
* $Id$
*/
#ifndef _WPS_
#define _WPS_
#ifdef __cplusplus
extern "C" {
#endif
/* Data Element Definitions */
#define WPS_ID_AP_CHANNEL 0x1001
#define WPS_ID_ASSOC_STATE 0x1002
#define WPS_ID_AUTH_TYPE 0x1003
#define WPS_ID_AUTH_TYPE_FLAGS 0x1004
#define WPS_ID_AUTHENTICATOR 0x1005
#define WPS_ID_CONFIG_METHODS 0x1008
#define WPS_ID_CONFIG_ERROR 0x1009
#define WPS_ID_CONF_URL4 0x100A
#define WPS_ID_CONF_URL6 0x100B
#define WPS_ID_CONN_TYPE 0x100C
#define WPS_ID_CONN_TYPE_FLAGS 0x100D
#define WPS_ID_CREDENTIAL 0x100E
#define WPS_ID_DEVICE_NAME 0x1011
#define WPS_ID_DEVICE_PWD_ID 0x1012
#define WPS_ID_E_HASH1 0x1014
#define WPS_ID_E_HASH2 0x1015
#define WPS_ID_E_SNONCE1 0x1016
#define WPS_ID_E_SNONCE2 0x1017
#define WPS_ID_ENCR_SETTINGS 0x1018
#define WPS_ID_ENCR_TYPE 0x100F
#define WPS_ID_ENCR_TYPE_FLAGS 0x1010
#define WPS_ID_ENROLLEE_NONCE 0x101A
#define WPS_ID_FEATURE_ID 0x101B
#define WPS_ID_IDENTITY 0x101C
#define WPS_ID_IDENTITY_PROOF 0x101D
#define WPS_ID_KEY_WRAP_AUTH 0x101E
#define WPS_ID_KEY_IDENTIFIER 0x101F
#define WPS_ID_MAC_ADDR 0x1020
#define WPS_ID_MANUFACTURER 0x1021
#define WPS_ID_MSG_TYPE 0x1022
#define WPS_ID_MODEL_NAME 0x1023
#define WPS_ID_MODEL_NUMBER 0x1024
#define WPS_ID_NW_INDEX 0x1026
#define WPS_ID_NW_KEY 0x1027
#define WPS_ID_NW_KEY_INDEX 0x1028
#define WPS_ID_NEW_DEVICE_NAME 0x1029
#define WPS_ID_NEW_PWD 0x102A
#define WPS_ID_OOB_DEV_PWD 0x102C
#define WPS_ID_OS_VERSION 0x102D
#define WPS_ID_POWER_LEVEL 0x102F
#define WPS_ID_PSK_CURRENT 0x1030
#define WPS_ID_PSK_MAX 0x1031
#define WPS_ID_PUBLIC_KEY 0x1032
#define WPS_ID_RADIO_ENABLED 0x1033
#define WPS_ID_REBOOT 0x1034
#define WPS_ID_REGISTRAR_CURRENT 0x1035
#define WPS_ID_REGISTRAR_ESTBLSHD 0x1036
#define WPS_ID_REGISTRAR_LIST 0x1037
#define WPS_ID_REGISTRAR_MAX 0x1038
#define WPS_ID_REGISTRAR_NONCE 0x1039
#define WPS_ID_REQ_TYPE 0x103A
#define WPS_ID_RESP_TYPE 0x103B
#define WPS_ID_RF_BAND 0x103C
#define WPS_ID_R_HASH1 0x103D
#define WPS_ID_R_HASH2 0x103E
#define WPS_ID_R_SNONCE1 0x103F
#define WPS_ID_R_SNONCE2 0x1040
#define WPS_ID_SEL_REGISTRAR 0x1041
#define WPS_ID_SERIAL_NUM 0x1042
#define WPS_ID_SC_STATE 0x1044
#define WPS_ID_SSID 0x1045
#define WPS_ID_TOT_NETWORKS 0x1046
#define WPS_ID_UUID_E 0x1047
#define WPS_ID_UUID_R 0x1048
#define WPS_ID_VENDOR_EXT 0x1049
#define WPS_ID_VERSION 0x104A
#define WPS_ID_X509_CERT_REQ 0x104B
#define WPS_ID_X509_CERT 0x104C
#define WPS_ID_EAP_IDENTITY 0x104D
#define WPS_ID_MSG_COUNTER 0x104E
#define WPS_ID_PUBKEY_HASH 0x104F
#define WPS_ID_REKEY_KEY 0x1050
#define WPS_ID_KEY_LIFETIME 0x1051
#define WPS_ID_PERM_CFG_METHODS 0x1052
#define WPS_ID_SEL_REG_CFG_METHODS 0x1053
#define WPS_ID_PRIM_DEV_TYPE 0x1054
#define WPS_ID_SEC_DEV_TYPE_LIST 0x1055
#define WPS_ID_PORTABLE_DEVICE 0x1056
#define WPS_ID_AP_SETUP_LOCKED 0x1057
#define WPS_ID_APP_LIST 0x1058
#define WPS_ID_EAP_TYPE 0x1059
#define WPS_ID_INIT_VECTOR 0x1060
#define WPS_ID_KEY_PROVIDED_AUTO 0x1061
#define WPS_ID_8021X_ENABLED 0x1062
#define WPS_ID_WEP_TRANSMIT_KEY 0x1064
#define WPS_ID_REQ_DEV_TYPE 0x106A
/* WSC 2.0, WFA Vendor Extension Subelements */
#define WFA_VENDOR_EXT_ID "\x00\x37\x2A"
#define WPS_WFA_SUBID_VERSION2 0x00
#define WPS_WFA_SUBID_AUTHORIZED_MACS 0x01
#define WPS_WFA_SUBID_NW_KEY_SHAREABLE 0x02
#define WPS_WFA_SUBID_REQ_TO_ENROLL 0x03
#define WPS_WFA_SUBID_SETTINGS_DELAY_TIME 0x04
/* WCN-NET Windows Rally Vertical Pairing Vendor Extensions */
#define MS_VENDOR_EXT_ID "\x00\x01\x37"
#define WPS_MS_ID_VPI 0x1001 /* Vertical Pairing Identifier TLV */
#define WPS_MS_ID_TRANSPORT_UUID 0x1002 /* Transport UUID TLV */
/* Vertical Pairing Identifier TLV Definitions */
#define WPS_MS_VPI_TRANSPORT_NONE 0x00 /* None */
#define WPS_MS_VPI_TRANSPORT_DPWS 0x01 /* Devices Profile for Web Services */
#define WPS_MS_VPI_TRANSPORT_UPNP 0x02 /* uPnP */
#define WPS_MS_VPI_TRANSPORT_SDNWS 0x03 /* Secure Devices Profile for Web Services */
#define WPS_MS_VPI_NO_PROFILE_REQ 0x00 /* Wi-Fi profile not requested.
* Not supported in Windows 7
*/
#define WPS_MS_VPI_PROFILE_REQ 0x01 /* Wi-Fi profile requested. */
/* sizes of the fixed size elements */
#define WPS_ID_AP_CHANNEL_S 2
#define WPS_ID_ASSOC_STATE_S 2
#define WPS_ID_AUTH_TYPE_S 2
#define WPS_ID_AUTH_TYPE_FLAGS_S 2
#define WPS_ID_AUTHENTICATOR_S 8
#define WPS_ID_CONFIG_METHODS_S 2
#define WPS_ID_CONFIG_ERROR_S 2
#define WPS_ID_CONN_TYPE_S 1
#define WPS_ID_CONN_TYPE_FLAGS_S 1
#define WPS_ID_DEVICE_PWD_ID_S 2
#define WPS_ID_ENCR_TYPE_S 2
#define WPS_ID_ENCR_TYPE_FLAGS_S 2
#define WPS_ID_FEATURE_ID_S 4
#define WPS_ID_MAC_ADDR_S 6
#define WPS_ID_MSG_TYPE_S 1
#define WPS_ID_SC_STATE_S 1
#define WPS_ID_RF_BAND_S 1
#define WPS_ID_OS_VERSION_S 4
#define WPS_ID_VERSION_S 1
#define WPS_ID_SEL_REGISTRAR_S 1
#define WPS_ID_SEL_REG_CFG_METHODS_S 2
#define WPS_ID_REQ_TYPE_S 1
#define WPS_ID_RESP_TYPE_S 1
#define WPS_ID_AP_SETUP_LOCKED_S 1
/* WSC 2.0, WFA Vendor Extension Subelements */
#define WPS_WFA_SUBID_VERSION2_S 1
#define WPS_WFA_SUBID_NW_KEY_SHAREABLE_S 1
#define WPS_WFA_SUBID_REQ_TO_ENROLL_S 1
#define WPS_WFA_SUBID_SETTINGS_DELAY_TIME_S 1
/* Association states */
#define WPS_ASSOC_NOT_ASSOCIATED 0
#define WPS_ASSOC_CONN_SUCCESS 1
#define WPS_ASSOC_CONFIG_FAIL 2
#define WPS_ASSOC_ASSOC_FAIL 3
#define WPS_ASSOC_IP_FAIL 4
/* Authentication types */
#define WPS_AUTHTYPE_OPEN 0x0001
#define WPS_AUTHTYPE_WPAPSK 0x0002 /* Deprecated in WSC 2.0 */
#define WPS_AUTHTYPE_SHARED 0x0004 /* Deprecated in WSC 2.0 */
#define WPS_AUTHTYPE_WPA 0x0008 /* Deprecated in WSC 2.0 */
#define WPS_AUTHTYPE_WPA2 0x0010
#define WPS_AUTHTYPE_WPA2PSK 0x0020
/* Config methods */
#define WPS_CONFMET_USBA 0x0001 /* Deprecated in WSC 2.0 */
#define WPS_CONFMET_ETHERNET 0x0002 /* Deprecated in WSC 2.0 */
#define WPS_CONFMET_LABEL 0x0004
#define WPS_CONFMET_DISPLAY 0x0008
#define WPS_CONFMET_EXT_NFC_TOK 0x0010
#define WPS_CONFMET_INT_NFC_TOK 0x0020
#define WPS_CONFMET_NFC_INTF 0x0040
#define WPS_CONFMET_PBC 0x0080
#define WPS_CONFMET_KEYPAD 0x0100
/* WSC 2.0 */
#define WPS_CONFMET_VIRT_PBC 0x0280
#define WPS_CONFMET_PHY_PBC 0x0480
#define WPS_CONFMET_VIRT_DISPLAY 0x2008
#define WPS_CONFMET_PHY_DISPLAY 0x4008
/* WPS error messages */
#define WPS_ERROR_NO_ERROR 0
#define WPS_ERROR_OOB_INT_READ_ERR 1
#define WPS_ERROR_DECRYPT_CRC_FAIL 2
#define WPS_ERROR_CHAN24_NOT_SUPP 3
#define WPS_ERROR_CHAN50_NOT_SUPP 4
#define WPS_ERROR_SIGNAL_WEAK 5 /* Deprecated in WSC 2.0 */
#define WPS_ERROR_NW_AUTH_FAIL 6 /* Deprecated in WSC 2.0 */
#define WPS_ERROR_NW_ASSOC_FAIL 7 /* Deprecated in WSC 2.0 */
#define WPS_ERROR_NO_DHCP_RESP 8 /* Deprecated in WSC 2.0 */
#define WPS_ERROR_FAILED_DHCP_CONF 9 /* Deprecated in WSC 2.0 */
#define WPS_ERROR_IP_ADDR_CONFLICT 10 /* Deprecated in WSC 2.0 */
#define WPS_ERROR_FAIL_CONN_REGISTRAR 11
#define WPS_ERROR_MULTI_PBC_DETECTED 12
#define WPS_ERROR_ROGUE_SUSPECTED 13
#define WPS_ERROR_DEVICE_BUSY 14
#define WPS_ERROR_SETUP_LOCKED 15
#define WPS_ERROR_MSG_TIMEOUT 16 /* Deprecated in WSC 2.0 */
#define WPS_ERROR_REG_SESSION_TIMEOUT 17 /* Deprecated in WSC 2.0 */
#define WPS_ERROR_DEV_PWD_AUTH_FAIL 18
/* Connection types */
#define WPS_CONNTYPE_ESS 0x01
#define WPS_CONNTYPE_IBSS 0x02
/* Device password ID */
#define WPS_DEVICEPWDID_DEFAULT 0x0000
#define WPS_DEVICEPWDID_USER_SPEC 0x0001
#define WPS_DEVICEPWDID_MACHINE_SPEC 0x0002
#define WPS_DEVICEPWDID_REKEY 0x0003
#define WPS_DEVICEPWDID_PUSH_BTN 0x0004
#define WPS_DEVICEPWDID_REG_SPEC 0x0005
/* Encryption type */
#define WPS_ENCRTYPE_NONE 0x0001
#define WPS_ENCRTYPE_WEP 0x0002 /* Deprecated in WSC 2.0 */
#define WPS_ENCRTYPE_TKIP 0x0004 /* Deprecated in version 2.0. TKIP can only
* be advertised on the AP when Mixed Mode
* is enabled (Encryption Type is 0x000c).
*/
#define WPS_ENCRTYPE_AES 0x0008
/* WPS Message Types */
#define WPS_ID_BEACON 0x01
#define WPS_ID_PROBE_REQ 0x02
#define WPS_ID_PROBE_RESP 0x03
#define WPS_ID_MESSAGE_M1 0x04
#define WPS_ID_MESSAGE_M2 0x05
#define WPS_ID_MESSAGE_M2D 0x06
#define WPS_ID_MESSAGE_M3 0x07
#define WPS_ID_MESSAGE_M4 0x08
#define WPS_ID_MESSAGE_M5 0x09
#define WPS_ID_MESSAGE_M6 0x0A
#define WPS_ID_MESSAGE_M7 0x0B
#define WPS_ID_MESSAGE_M8 0x0C
#define WPS_ID_MESSAGE_ACK 0x0D
#define WPS_ID_MESSAGE_NACK 0x0E
#define WPS_ID_MESSAGE_DONE 0x0F
/* WSP private ID for local use */
#define WPS_PRIVATE_ID_IDENTITY (WPS_ID_MESSAGE_DONE + 1)
#define WPS_PRIVATE_ID_WPS_START (WPS_ID_MESSAGE_DONE + 2)
#define WPS_PRIVATE_ID_FAILURE (WPS_ID_MESSAGE_DONE + 3)
#define WPS_PRIVATE_ID_FRAG (WPS_ID_MESSAGE_DONE + 4)
#define WPS_PRIVATE_ID_FRAG_ACK (WPS_ID_MESSAGE_DONE + 5)
#define WPS_PRIVATE_ID_EAPOL_START (WPS_ID_MESSAGE_DONE + 6)
/* Device Type categories for primary and secondary device types */
#define WPS_DEVICE_TYPE_CAT_COMPUTER 1
#define WPS_DEVICE_TYPE_CAT_INPUT_DEVICE 2
#define WPS_DEVICE_TYPE_CAT_PRINTER 3
#define WPS_DEVICE_TYPE_CAT_CAMERA 4
#define WPS_DEVICE_TYPE_CAT_STORAGE 5
#define WPS_DEVICE_TYPE_CAT_NW_INFRA 6
#define WPS_DEVICE_TYPE_CAT_DISPLAYS 7
#define WPS_DEVICE_TYPE_CAT_MM_DEVICES 8
#define WPS_DEVICE_TYPE_CAT_GAME_DEVICES 9
#define WPS_DEVICE_TYPE_CAT_TELEPHONE 10
#define WPS_DEVICE_TYPE_CAT_AUDIO_DEVICES 11 /* WSC 2.0 */
/* Device Type sub categories for primary and secondary device types */
#define WPS_DEVICE_TYPE_SUB_CAT_COMP_PC 1
#define WPS_DEVICE_TYPE_SUB_CAT_COMP_SERVER 2
#define WPS_DEVICE_TYPE_SUB_CAT_COMP_MEDIA_CTR 3
#define WPS_DEVICE_TYPE_SUB_CAT_COMP_UM_PC 4 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_COMP_NOTEBOOK 5 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_COMP_DESKTOP 6 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_COMP_MID 7 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_COMP_NETBOOK 8 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_INP_Keyboard 1 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_INP_MOUSE 2 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_INP_JOYSTICK 3 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_INP_TRACKBALL 4 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_INP_GAM_CTRL 5 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_INP_REMOTE 6 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_INP_TOUCHSCREEN 7 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_INP_BIO_READER 8 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_INP_BAR_READER 9 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_PRTR_PRINTER 1
#define WPS_DEVICE_TYPE_SUB_CAT_PRTR_SCANNER 2
#define WPS_DEVICE_TYPE_SUB_CAT_PRTR_FAX 3 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_PRTR_COPIER 4 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_PRTR_ALLINONE 5 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_CAM_DGTL_STILL 1
#define WPS_DEVICE_TYPE_SUB_CAT_CAM_VIDEO_CAM 2 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_CAM_WEB_CAM 3 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_CAM_SECU_CAM 4 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_STOR_NAS 1
#define WPS_DEVICE_TYPE_SUB_CAT_NW_AP 1
#define WPS_DEVICE_TYPE_SUB_CAT_NW_ROUTER 2
#define WPS_DEVICE_TYPE_SUB_CAT_NW_SWITCH 3
#define WPS_DEVICE_TYPE_SUB_CAT_NW_GATEWAY 4 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_NW_BRIDGE 5 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_DISP_TV 1
#define WPS_DEVICE_TYPE_SUB_CAT_DISP_PIC_FRAME 2
#define WPS_DEVICE_TYPE_SUB_CAT_DISP_PROJECTOR 3
#define WPS_DEVICE_TYPE_SUB_CAT_DISP_MONITOR 4 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_MM_DAR 1
#define WPS_DEVICE_TYPE_SUB_CAT_MM_PVR 2
#define WPS_DEVICE_TYPE_SUB_CAT_MM_MCX 3
#define WPS_DEVICE_TYPE_SUB_CAT_MM_STB 4 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_MM_MS_ME 5 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_MM_PVP 6 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_GAM_XBOX 1
#define WPS_DEVICE_TYPE_SUB_CAT_GAM_XBOX_360 2
#define WPS_DEVICE_TYPE_SUB_CAT_GAM_PS 3
#define WPS_DEVICE_TYPE_SUB_CAT_GAM_GC 4 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_GAM_PGD 5 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_PHONE_WM 1
#define WPS_DEVICE_TYPE_SUB_CAT_PHONE_PSM 2 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_PHONE_PDM 3 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_PHONE_SSM 4 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_PHONE_SDM 5 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_AUDIO_TUNER 1 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_AUDIO_SPEAKERS 2 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_AUDIO_PMP 3 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_AUDIO_HEADSET 4 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_AUDIO_HPHONE 5 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_AUDIO_MPHONE 6 /* WSC 2.0 */
#define WPS_DEVICE_TYPE_SUB_CAT_AUDIO_HTS 7 /* WSC 2.0 */
/* Device request/response type */
#define WPS_MSGTYPE_ENROLLEE_INFO_ONLY 0x00
#define WPS_MSGTYPE_ENROLLEE_OPEN_8021X 0x01
#define WPS_MSGTYPE_REGISTRAR 0x02
#define WPS_MSGTYPE_AP_WLAN_MGR 0x03
/* RF Band */
#define WPS_RFBAND_24GHZ 0x01
#define WPS_RFBAND_50GHZ 0x02
/* Simple Config state */
#define WPS_SCSTATE_UNCONFIGURED 0x01
#define WPS_SCSTATE_CONFIGURED 0x02
#define WPS_SCSTATE_OFF 11
/* WPS Vendor extension key */
#define WPS_OUI_HEADER_LEN 2
#define WPS_OUI_HEADER_SIZE 4
#define WPS_OUI_FIXED_HEADER_OFF 16
#define WPS_WFA_SUBID_V2_OFF 3
#define WPS_WFA_V2_OFF 5
#ifdef __cplusplus
}
#endif
#endif /* _WPS_ */