fwil.h (a23e1966932464e1c5226cb9ac4ce1d5fc10ba22) fwil.h (c6002b6c05f3edfa12fd25990cc637281f200442)
1// SPDX-License-Identifier: ISC
2/*
3 * Copyright (c) 2012 Broadcom Corporation
4 */
5
6#ifndef _fwil_h_
7#define _fwil_h_
8

--- 82 unchanged lines hidden (view full) ---

91 err = brcmf_fil_cmd_data_set(ifp, cmd, &data_le, sizeof(data_le));
92
93 return err;
94}
95static inline
96s32 brcmf_fil_cmd_int_get(struct brcmf_if *ifp, u32 cmd, u32 *data)
97{
98 s32 err;
1// SPDX-License-Identifier: ISC
2/*
3 * Copyright (c) 2012 Broadcom Corporation
4 */
5
6#ifndef _fwil_h_
7#define _fwil_h_
8

--- 82 unchanged lines hidden (view full) ---

91 err = brcmf_fil_cmd_data_set(ifp, cmd, &data_le, sizeof(data_le));
92
93 return err;
94}
95static inline
96s32 brcmf_fil_cmd_int_get(struct brcmf_if *ifp, u32 cmd, u32 *data)
97{
98 s32 err;
99 __le32 data_le = cpu_to_le32(*data);
100
99
101 err = brcmf_fil_cmd_data_get(ifp, cmd, &data_le, sizeof(data_le));
100 err = brcmf_fil_cmd_data_get(ifp, cmd, data, sizeof(*data));
102 if (err == 0)
101 if (err == 0)
103 *data = le32_to_cpu(data_le);
102 *data = le32_to_cpu(*(__le32 *)data);
104 brcmf_dbg(FIL, "ifidx=%d, cmd=%d, value=%d\n", ifp->ifidx, cmd, *data);
105
106 return err;
107}
103 brcmf_dbg(FIL, "ifidx=%d, cmd=%d, value=%d\n", ifp->ifidx, cmd, *data);
104
105 return err;
106}
107static inline
108s32 brcmf_fil_cmd_int_query(struct brcmf_if *ifp, u32 cmd, u32 *data)
109{
110 __le32 *data_le = (__le32 *)data;
108
111
112 *data_le = cpu_to_le32(*data);
113 return brcmf_fil_cmd_int_get(ifp, cmd, data);
114}
115
109s32 brcmf_fil_iovar_data_set(struct brcmf_if *ifp, const char *name,
110 const void *data, u32 len);
111s32 brcmf_fil_iovar_data_get(struct brcmf_if *ifp, const char *name, void *data,
112 u32 len);
113static inline
114s32 brcmf_fil_iovar_int_set(struct brcmf_if *ifp, const char *name, u32 data)
115{
116 __le32 data_le = cpu_to_le32(data);
117
118 return brcmf_fil_iovar_data_set(ifp, name, &data_le, sizeof(data_le));
119}
120static inline
121s32 brcmf_fil_iovar_int_get(struct brcmf_if *ifp, const char *name, u32 *data)
122{
116s32 brcmf_fil_iovar_data_set(struct brcmf_if *ifp, const char *name,
117 const void *data, u32 len);
118s32 brcmf_fil_iovar_data_get(struct brcmf_if *ifp, const char *name, void *data,
119 u32 len);
120static inline
121s32 brcmf_fil_iovar_int_set(struct brcmf_if *ifp, const char *name, u32 data)
122{
123 __le32 data_le = cpu_to_le32(data);
124
125 return brcmf_fil_iovar_data_set(ifp, name, &data_le, sizeof(data_le));
126}
127static inline
128s32 brcmf_fil_iovar_int_get(struct brcmf_if *ifp, const char *name, u32 *data)
129{
123 __le32 data_le = cpu_to_le32(*data);
124 s32 err;
125
130 s32 err;
131
126 err = brcmf_fil_iovar_data_get(ifp, name, &data_le, sizeof(data_le));
132 err = brcmf_fil_iovar_data_get(ifp, name, data, sizeof(*data));
127 if (err == 0)
133 if (err == 0)
128 *data = le32_to_cpu(data_le);
134 *data = le32_to_cpu(*(__le32 *)data);
129 return err;
130}
135 return err;
136}
137static inline
138s32 brcmf_fil_iovar_int_query(struct brcmf_if *ifp, const char *name, u32 *data)
139{
140 __le32 *data_le = (__le32 *)data;
131
141
142 *data_le = cpu_to_le32(*data);
143 return brcmf_fil_iovar_int_get(ifp, name, data);
144}
132
145
146
133s32 brcmf_fil_bsscfg_data_set(struct brcmf_if *ifp, const char *name,
134 void *data, u32 len);
135s32 brcmf_fil_bsscfg_data_get(struct brcmf_if *ifp, const char *name,
136 void *data, u32 len);
137static inline
138s32 brcmf_fil_bsscfg_int_set(struct brcmf_if *ifp, const char *name, u32 data)
139{
140 __le32 data_le = cpu_to_le32(data);
141
142 return brcmf_fil_bsscfg_data_set(ifp, name, &data_le,
143 sizeof(data_le));
144}
145static inline
146s32 brcmf_fil_bsscfg_int_get(struct brcmf_if *ifp, const char *name, u32 *data)
147{
147s32 brcmf_fil_bsscfg_data_set(struct brcmf_if *ifp, const char *name,
148 void *data, u32 len);
149s32 brcmf_fil_bsscfg_data_get(struct brcmf_if *ifp, const char *name,
150 void *data, u32 len);
151static inline
152s32 brcmf_fil_bsscfg_int_set(struct brcmf_if *ifp, const char *name, u32 data)
153{
154 __le32 data_le = cpu_to_le32(data);
155
156 return brcmf_fil_bsscfg_data_set(ifp, name, &data_le,
157 sizeof(data_le));
158}
159static inline
160s32 brcmf_fil_bsscfg_int_get(struct brcmf_if *ifp, const char *name, u32 *data)
161{
148 __le32 data_le = cpu_to_le32(*data);
149 s32 err;
150
162 s32 err;
163
151 err = brcmf_fil_bsscfg_data_get(ifp, name, &data_le,
152 sizeof(data_le));
164 err = brcmf_fil_bsscfg_data_get(ifp, name, data, sizeof(*data));
153 if (err == 0)
165 if (err == 0)
154 *data = le32_to_cpu(data_le);
166 *data = le32_to_cpu(*(__le32 *)data);
155 return err;
156}
167 return err;
168}
169static inline
170s32 brcmf_fil_bsscfg_int_query(struct brcmf_if *ifp, const char *name, u32 *data)
171{
172 __le32 *data_le = (__le32 *)data;
157
173
174 *data_le = cpu_to_le32(*data);
175 return brcmf_fil_bsscfg_int_get(ifp, name, data);
176}
177
158s32 brcmf_fil_xtlv_data_set(struct brcmf_if *ifp, const char *name, u16 id,
159 void *data, u32 len);
160s32 brcmf_fil_xtlv_data_get(struct brcmf_if *ifp, const char *name, u16 id,
161 void *data, u32 len);
162static inline
163s32 brcmf_fil_xtlv_int_set(struct brcmf_if *ifp, const char *name, u16 id,
164 u32 data)
165{

--- 37 unchanged lines hidden ---
178s32 brcmf_fil_xtlv_data_set(struct brcmf_if *ifp, const char *name, u16 id,
179 void *data, u32 len);
180s32 brcmf_fil_xtlv_data_get(struct brcmf_if *ifp, const char *name, u16 id,
181 void *data, u32 len);
182static inline
183s32 brcmf_fil_xtlv_int_set(struct brcmf_if *ifp, const char *name, u16 id,
184 u32 data)
185{

--- 37 unchanged lines hidden ---