1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34#include "ttype.h"
35#include "tmacro.h"
36#include "tether.h"
37#include "IEEE11h.h"
38#include "device.h"
39#include "wmgr.h"
40#include "rxtx.h"
41#include "channel.h"
42
43
44
45#pragma pack(1)
46
47typedef struct _WLAN_FRAME_ACTION {
48 WLAN_80211HDR_A3 Header;
49 unsigned char byCategory;
50 unsigned char byAction;
51 unsigned char abyVars[1];
52} WLAN_FRAME_ACTION, *PWLAN_FRAME_ACTION;
53
54typedef struct _WLAN_FRAME_MSRREQ {
55 WLAN_80211HDR_A3 Header;
56 unsigned char byCategory;
57 unsigned char byAction;
58 unsigned char byDialogToken;
59 WLAN_IE_MEASURE_REQ sMSRReqEIDs[1];
60} WLAN_FRAME_MSRREQ, *PWLAN_FRAME_MSRREQ;
61
62typedef struct _WLAN_FRAME_MSRREP {
63 WLAN_80211HDR_A3 Header;
64 unsigned char byCategory;
65 unsigned char byAction;
66 unsigned char byDialogToken;
67 WLAN_IE_MEASURE_REP sMSRRepEIDs[1];
68} WLAN_FRAME_MSRREP, *PWLAN_FRAME_MSRREP;
69
70typedef struct _WLAN_FRAME_TPCREQ {
71 WLAN_80211HDR_A3 Header;
72 unsigned char byCategory;
73 unsigned char byAction;
74 unsigned char byDialogToken;
75 WLAN_IE_TPC_REQ sTPCReqEIDs;
76} WLAN_FRAME_TPCREQ, *PWLAN_FRAME_TPCREQ;
77
78typedef struct _WLAN_FRAME_TPCREP {
79 WLAN_80211HDR_A3 Header;
80 unsigned char byCategory;
81 unsigned char byAction;
82 unsigned char byDialogToken;
83 WLAN_IE_TPC_REP sTPCRepEIDs;
84} WLAN_FRAME_TPCREP, *PWLAN_FRAME_TPCREP;
85
86#pragma pack()
87
88
89#define ACTION_MSRREQ 0
90#define ACTION_MSRREP 1
91#define ACTION_TPCREQ 2
92#define ACTION_TPCREP 3
93#define ACTION_CHSW 4
94
95
96
97
98
99
100
101
102
103
104
105bool IEEE11hbMSRRepTx(void *pMgmtHandle)
106{
107 PSMgmtObject pMgmt = (PSMgmtObject) pMgmtHandle;
108 PWLAN_FRAME_MSRREP pMSRRep = (PWLAN_FRAME_MSRREP)
109 (pMgmt->abyCurrentMSRRep + sizeof(STxMgmtPacket));
110 size_t uLength = 0;
111 PSTxMgmtPacket pTxPacket = NULL;
112
113 pTxPacket = (PSTxMgmtPacket)pMgmt->abyCurrentMSRRep;
114 memset(pTxPacket, 0, sizeof(STxMgmtPacket) + WLAN_A3FR_MAXLEN);
115 pTxPacket->p80211Header = (PUWLAN_80211HDR)((unsigned char *)pTxPacket +
116 sizeof(STxMgmtPacket));
117
118 pMSRRep->Header.wFrameCtl = (WLAN_SET_FC_FTYPE(WLAN_FTYPE_MGMT) |
119 WLAN_SET_FC_FSTYPE(WLAN_FSTYPE_ACTION)
120);
121
122 memcpy(pMSRRep->Header.abyAddr1, ((PWLAN_FRAME_MSRREQ)
123 (pMgmt->abyCurrentMSRReq))->Header.abyAddr2, WLAN_ADDR_LEN);
124 memcpy(pMSRRep->Header.abyAddr2,
125 CARDpGetCurrentAddress(pMgmt->pAdapter), WLAN_ADDR_LEN);
126 memcpy(pMSRRep->Header.abyAddr3, pMgmt->abyCurrBSSID, WLAN_BSSID_LEN);
127
128 pMSRRep->byCategory = 0;
129 pMSRRep->byAction = 1;
130 pMSRRep->byDialogToken = ((PWLAN_FRAME_MSRREQ)
131 (pMgmt->abyCurrentMSRReq))->byDialogToken;
132
133 uLength = pMgmt->uLengthOfRepEIDs + offsetof(WLAN_FRAME_MSRREP,
134 sMSRRepEIDs);
135
136 pTxPacket->cbMPDULen = uLength;
137 pTxPacket->cbPayloadLen = uLength - WLAN_HDR_ADDR3_LEN;
138 if (csMgmt_xmit(pMgmt->pAdapter, pTxPacket) != CMD_STATUS_PENDING)
139 return false;
140 return true;
141}
142