blob: 648fd632b606d5ec60179939c27d5bbccfafaf90 [file] [log] [blame]
Greg Kroah-Hartman91980992008-10-28 14:48:09 -07001/*
2 *************************************************************************
3 * Ralink Tech Inc.
4 * 5F., No.36, Taiyuan St., Jhubei City,
5 * Hsinchu County 302,
6 * Taiwan, R.O.C.
7 *
8 * (c) Copyright 2002-2007, Ralink Technology, Inc.
9 *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 * This program is distributed in the hope that it will be useful, *
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
18 * GNU General Public License for more details. *
19 * *
20 * You should have received a copy of the GNU General Public License *
21 * along with this program; if not, write to the *
22 * Free Software Foundation, Inc., *
23 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
24 * *
25 *************************************************************************
Bartlomiej Zolnierkiewiczca97b832009-09-22 20:44:07 +020026 */
Greg Kroah-Hartman91980992008-10-28 14:48:09 -070027
28#ifndef __SPECTRUM_H__
29#define __SPECTRUM_H__
30
31#include "rtmp_type.h"
32#include "spectrum_def.h"
33
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -080034char RTMP_GetTxPwr(struct rt_rtmp_adapter *pAd, IN HTTRANSMIT_SETTING HTTxMode);
Greg Kroah-Hartman91980992008-10-28 14:48:09 -070035
36/*
37 ==========================================================================
38 Description:
39 Prepare Measurement request action frame and enqueue it into
40 management queue waiting for transmition.
41
42 Parametrs:
43 1. the destination mac address of the frame.
44
45 Return : None.
46 ==========================================================================
47 */
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -080048void MakeMeasurementReqFrame(struct rt_rtmp_adapter *pAd,
Bartlomiej Zolnierkiewicz51126de2009-12-11 12:23:15 -080049 u8 *pOutBuffer,
50 unsigned long *pFrameLen,
51 u8 TotalLen,
52 u8 Category,
53 u8 Action,
54 u8 MeasureToken,
55 u8 MeasureReqMode,
56 u8 MeasureReqType,
57 u8 NumOfRepetitions);
Greg Kroah-Hartman91980992008-10-28 14:48:09 -070058
59/*
60 ==========================================================================
61 Description:
62 Prepare Measurement report action frame and enqueue it into
63 management queue waiting for transmition.
64
65 Parametrs:
66 1. the destination mac address of the frame.
67
68 Return : None.
69 ==========================================================================
70 */
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -080071void EnqueueMeasurementRep(struct rt_rtmp_adapter *pAd,
Bartlomiej Zolnierkiewicz51126de2009-12-11 12:23:15 -080072 u8 *pDA,
73 u8 DialogToken,
74 u8 MeasureToken,
75 u8 MeasureReqMode,
76 u8 MeasureReqType,
77 u8 ReportInfoLen, u8 *pReportInfo);
Greg Kroah-Hartman91980992008-10-28 14:48:09 -070078
79/*
80 ==========================================================================
81 Description:
82 Prepare TPC Request action frame and enqueue it into
83 management queue waiting for transmition.
84
85 Parametrs:
86 1. the destination mac address of the frame.
87
88 Return : None.
89 ==========================================================================
90 */
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -080091void EnqueueTPCReq(struct rt_rtmp_adapter *pAd, u8 *pDA, u8 DialogToken);
Greg Kroah-Hartman91980992008-10-28 14:48:09 -070092
93/*
94 ==========================================================================
95 Description:
96 Prepare TPC Report action frame and enqueue it into
97 management queue waiting for transmition.
98
99 Parametrs:
100 1. the destination mac address of the frame.
101
102 Return : None.
103 ==========================================================================
104 */
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -0800105void EnqueueTPCRep(struct rt_rtmp_adapter *pAd,
Bartlomiej Zolnierkiewicz51126de2009-12-11 12:23:15 -0800106 u8 *pDA,
107 u8 DialogToken, u8 TxPwr, u8 LinkMargin);
Greg Kroah-Hartman91980992008-10-28 14:48:09 -0700108
109/*
110 ==========================================================================
111 Description:
112 Prepare Channel Switch Announcement action frame and enqueue it into
113 management queue waiting for transmition.
114
115 Parametrs:
116 1. the destination mac address of the frame.
117 2. Channel switch announcement mode.
118 2. a New selected channel.
119
120 Return : None.
121 ==========================================================================
122 */
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -0800123void EnqueueChSwAnn(struct rt_rtmp_adapter *pAd,
Bartlomiej Zolnierkiewicz51126de2009-12-11 12:23:15 -0800124 u8 *pDA, u8 ChSwMode, u8 NewCh);
Greg Kroah-Hartman91980992008-10-28 14:48:09 -0700125
126/*
127 ==========================================================================
128 Description:
129 Spectrun action frames Handler such as channel switch annoucement,
130 measurement report, measurement request actions frames.
131
132 Parametrs:
133 Elme - MLME message containing the received frame
134
135 Return : None.
136 ==========================================================================
137 */
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -0800138void PeerSpectrumAction(struct rt_rtmp_adapter *pAd, struct rt_mlme_queue_elem *Elem);
Greg Kroah-Hartman91980992008-10-28 14:48:09 -0700139
140/*
141 ==========================================================================
142 Description:
143
144 Parametrs:
145
146 Return : None.
147 ==========================================================================
148 */
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -0800149int Set_MeasureReq_Proc(struct rt_rtmp_adapter *pAd, char *arg);
Greg Kroah-Hartman91980992008-10-28 14:48:09 -0700150
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -0800151int Set_TpcReq_Proc(struct rt_rtmp_adapter *pAd, char *arg);
Bartlomiej Zolnierkiewiczca97b832009-09-22 20:44:07 +0200152
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -0800153int Set_PwrConstraint(struct rt_rtmp_adapter *pAd, char *arg);
Bartlomiej Zolnierkiewiczca97b832009-09-22 20:44:07 +0200154
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -0800155void MeasureReqTabInit(struct rt_rtmp_adapter *pAd);
Greg Kroah-Hartman91980992008-10-28 14:48:09 -0700156
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -0800157void MeasureReqTabExit(struct rt_rtmp_adapter *pAd);
Greg Kroah-Hartman91980992008-10-28 14:48:09 -0700158
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -0800159struct rt_measure_req_entry *MeasureReqLookUp(struct rt_rtmp_adapter *pAd, u8 DialogToken);
Greg Kroah-Hartman91980992008-10-28 14:48:09 -0700160
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -0800161struct rt_measure_req_entry *MeasureReqInsert(struct rt_rtmp_adapter *pAd, u8 DialogToken);
Bartlomiej Zolnierkiewiczca97b832009-09-22 20:44:07 +0200162
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -0800163void MeasureReqDelete(struct rt_rtmp_adapter *pAd, u8 DialogToken);
Bartlomiej Zolnierkiewiczca97b832009-09-22 20:44:07 +0200164
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -0800165void InsertChannelRepIE(struct rt_rtmp_adapter *pAd,
Bartlomiej Zolnierkiewicz51126de2009-12-11 12:23:15 -0800166 u8 *pFrameBuf,
167 unsigned long *pFrameLen,
168 char *pCountry, u8 RegulatoryClass);
Bartlomiej Zolnierkiewiczca97b832009-09-22 20:44:07 +0200169
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -0800170void InsertTpcReportIE(struct rt_rtmp_adapter *pAd,
Bartlomiej Zolnierkiewicz51126de2009-12-11 12:23:15 -0800171 u8 *pFrameBuf,
172 unsigned long *pFrameLen,
173 u8 TxPwr, u8 LinkMargin);
Bartlomiej Zolnierkiewiczca97b832009-09-22 20:44:07 +0200174
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -0800175void InsertDialogToken(struct rt_rtmp_adapter *pAd,
Bartlomiej Zolnierkiewicz51126de2009-12-11 12:23:15 -0800176 u8 *pFrameBuf,
177 unsigned long *pFrameLen, u8 DialogToken);
Bartlomiej Zolnierkiewiczca97b832009-09-22 20:44:07 +0200178
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -0800179void TpcReqTabInit(struct rt_rtmp_adapter *pAd);
Bartlomiej Zolnierkiewiczca97b832009-09-22 20:44:07 +0200180
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -0800181void TpcReqTabExit(struct rt_rtmp_adapter *pAd);
Greg Kroah-Hartman91980992008-10-28 14:48:09 -0700182
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -0800183void NotifyChSwAnnToPeerAPs(struct rt_rtmp_adapter *pAd,
Bartlomiej Zolnierkiewicz51126de2009-12-11 12:23:15 -0800184 u8 *pRA,
185 u8 *pTA, u8 ChSwMode, u8 Channel);
Greg Kroah-Hartman91980992008-10-28 14:48:09 -0700186
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -0800187void RguClass_BuildBcnChList(struct rt_rtmp_adapter *pAd,
Bartlomiej Zolnierkiewicz51126de2009-12-11 12:23:15 -0800188 u8 *pBuf, unsigned long *pBufLen);
Bartlomiej Zolnierkiewiczcc277062009-12-11 12:23:15 -0800189#endif /* __SPECTRUM_H__ // */