blob: 6b268b713e86db7df0d5d11d375d27049f920d10 [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
2 * Copyright (c) 2010-2015 The Linux Foundation. All rights reserved.
3 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21
22/*
23 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27
28/*===========================================================================
29
30 dfs_ioctl_private.h
31
32 OVERVIEW:
33
34 Source code borrowed from QCA_MAIN DFS module
35
36 DEPENDENCIES:
37
38 Are listed for each API below.
39
40 ===========================================================================*/
41
42/*
43 * ioctl defines
44 */
45
46#ifndef _DFS_IOCTL_PRIVATE_H_
47#define _DFS_IOCTL_PRIVATE_H_
48
49/*
50 * Assert that the NOVAL values match.
51 */
52#if (ATH_DFS_PHYERR_PARAM_NOVAL != DFS_IOCTL_PARAM_NOVAL)
53#error "ATH_DFS_PHYERR_PARAM_NOVAL != DFS_IOCTL_PARAM_NOVAL"
54#endif
55
56/*
57 * Assert that the ENABLE values match.
58 */
59#if (ATH_DFS_PHYERR_PARAM_ENABLE != DFS_IOCTL_PARAM_ENABLE)
60#error "ATH_DFS_PHYERR_PARAM_ENABLE != DFS_IOCTL_PARAM_ENABLE"
61#endif
62
63/*
64 * These two methods are used by the lmac glue to copy between
65 * the DFS and HAL PHY configuration.
66 *
67 * I'm "cheating" here and assuming that the ENABLE and NOVAL
68 * values match - see the above macros.
69 */
70static inline void
71ath_dfs_ioctlparam_to_dfsparam(const struct dfs_ioctl_params *src,
72 struct ath_dfs_phyerr_param *dst)
73{
74
75 dst->pe_firpwr = src->dfs_firpwr;
76 dst->pe_rrssi = src->dfs_rrssi;
77 dst->pe_height = src->dfs_height;
78 dst->pe_prssi = src->dfs_prssi;
79 dst->pe_inband = src->dfs_inband;
80 dst->pe_relpwr = src->dfs_relpwr;
81 dst->pe_relstep = src->dfs_relstep;
82 dst->pe_maxlen = src->dfs_maxlen;
83}
84
85static inline void
86ath_dfs_dfsparam_to_ioctlparam(struct ath_dfs_phyerr_param *src,
87 struct dfs_ioctl_params *dst)
88{
89
90 dst->dfs_firpwr = src->pe_firpwr;
91 dst->dfs_rrssi = src->pe_rrssi;
92 dst->dfs_height = src->pe_height;
93 dst->dfs_prssi = src->pe_prssi;
94 dst->dfs_inband = src->pe_inband;
95 dst->dfs_relpwr = src->pe_relpwr;
96 dst->dfs_relstep = src->pe_relstep;
97 dst->dfs_maxlen = src->pe_maxlen;
98}
99
100#endif /* _DFS_IOCTL_PRIVATE_H_ */