switch on new verbose system
[openwrt.git] / package / broadcom-wl / src / wlc / include / wlutils.h
1 /*
2 * Broadcom wireless network adapter utility functions
3 *
4 * Copyright 2006, Broadcom Corporation
5 * All Rights Reserved.
6 *
7 * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
8 * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
9 * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
10 * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
11 *
12 * $Id: wlutils.h,v 1.1.1.12 2006/02/27 03:43:20 honor Exp $
13 */
14
15 #ifndef _wlutils_h_
16 #define _wlutils_h_
17
18 #include <typedefs.h>
19 #include <wlioctl.h>
20
21 /*
22 * Pass a wlioctl request to the specified interface.
23 * @param name interface name
24 * @param cmd WLC_GET_MAGIC <= cmd < WLC_LAST
25 * @param buf buffer for passing in and/or receiving data
26 * @param len length of buf
27 * @return >= 0 if successful or < 0 otherwise
28 */
29 extern int wl_ioctl(char *name, int cmd, void *buf, int len);
30
31 /*
32 * Probe the specified interface.
33 * @param name interface name
34 * @return >= 0 if a Broadcom wireless device or < 0 otherwise
35 */
36 extern int wl_probe(char *name);
37
38 extern int wl_iovar_set(char *ifname, char *iovar, void *param, int paramlen);
39 extern int wl_iovar_get(char *ifname, char *iovar, void *bufptr, int buflen);
40 /*
41 * Set/Get named variable.
42 * @param ifname interface name
43 * @param iovar variable name
44 * @param param input param value/buffer
45 * @param paramlen input param value/buffer length
46 * @param bufptr io buffer
47 * @param buflen io buffer length
48 * @param val val or val pointer for int routines
49 * @return success == 0, failure != 0
50 */
51 /*
52 * set named driver variable to int value
53 * calling example: wl_iovar_setint(ifname, "arate", rate)
54 */
55 static inline int
56 wl_iovar_setint(char *ifname, char *iovar, int val)
57 {
58 return wl_iovar_set(ifname, iovar, &val, sizeof(val));
59 }
60
61 /*
62 * get named driver variable to int value and return error indication
63 * calling example: wl_iovar_getint(ifname, "arate", &rate)
64 */
65 static inline int
66 wl_iovar_getint(char *ifname, char *iovar, int *val)
67 {
68 return wl_iovar_get(ifname, iovar, val, sizeof(int));
69 }
70
71 /*
72 * Set/Get named variable indexed by BSS Configuration
73 * @param ifname interface name
74 * @param iovar variable name
75 * @param bssidx bsscfg index
76 * @param param input param value/buffer
77 * @param paramlen input param value/buffer length
78 * @param bufptr io buffer
79 * @param buflen io buffer length
80 * @param val val or val pointer for int routines
81 * @return success == 0, failure != 0
82 */
83 extern int wl_bssiovar_get(char *ifname, char *iovar, int bssidx, void *outbuf, int len);
84 extern int wl_bssiovar_set(char *ifname, char *iovar, int bssidx, void *param, int paramlen);
85 /*
86 * set named & bss indexed driver variable to int value
87 */
88 static inline int
89 wl_bssiovar_setint(char *ifname, char *iovar, int bssidx, int val)
90 {
91 return wl_bssiovar_set(ifname, iovar, bssidx, &val, sizeof(int));
92 }
93
94 static inline int
95 wl_bssiovar_getint(char *ifname, char *iovar, int bssidx, int *val)
96 {
97 return wl_bssiovar_get(ifname, iovar, bssidx, val, sizeof(int));
98 }
99
100 extern int wl_bssiovar_setint(char *ifname, char *iovar, int bssidx, int val);
101
102 #endif /* _wlutils_h_ */
This page took 0.048372 seconds and 5 git commands to generate.