2 * Broadcom wireless network adapter utility functions
4 * Copyright 2005, Broadcom Corporation
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.
12 * $Id: wlutils.h,v 1.1.1.10 2005/03/07 07:31:20 kanki Exp $
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
29 extern int wl_ioctl(char *name
, int cmd
, void *buf
, int len
);
33 * @param name interface name
34 * @param buf buffer for passing in and/or receiving data
35 * @param len length of buf
36 * @return >= 0 if successful or < 0 otherwise
38 #define DEV_TYPE_LEN 3
39 extern int wl_get_dev_type(char *name
, void *buf
, int len
);
42 * Get the MAC (hardware) address of the specified interface.
43 * @param name interface name
44 * @param hwaddr 6-byte buffer for receiving address
45 * @return >= 0 if successful or < 0 otherwise
47 extern int wl_hwaddr(char *name
, unsigned char *hwaddr
);
50 * Probe the specified interface.
51 * @param name interface name
52 * @return >= 0 if a Broadcom wireless device or < 0 otherwise
54 extern int wl_probe(char *name
);
57 * Set/Get named variable.
58 * @param name interface name
59 * @param var variable name
60 * @param val variable value/buffer
61 * @param len variable value/buffer length
62 * @return success == 0, failure != 0
64 extern int wl_set_val(char *name
, char *var
, void *val
, int len
);
65 extern int wl_get_val(char *name
, char *var
, void *val
, int len
);
66 extern int wl_set_int(char *name
, char *var
, int val
);
67 extern int wl_get_int(char *name
, char *var
, int *val
);
69 static inline int wl_phytype_n(int phytype
)
71 return (phytype
== WLC_PHY_TYPE_N
)
72 #ifdef WLC_PHY_TYPE_SSN
73 || (phytype
== WLC_PHY_TYPE_SSN
)
75 #ifdef WLC_PHY_TYPE_LCN
76 || (phytype
== WLC_PHY_TYPE_LCN
)
78 #ifdef WLC_PHY_TYPE_HT
79 || (phytype
== WLC_PHY_TYPE_HT
)
86 * Set/Get named variable.
87 * @param ifname interface name
88 * @param iovar variable name
89 * @param param input param value/buffer
90 * @param paramlen input param value/buffer length
91 * @param bufptr io buffer
92 * @param buflen io buffer length
93 * @param val val or val pointer for int routines
94 * @return success == 0, failure != 0
96 extern int wl_iovar_setbuf(char *ifname
, char *iovar
, void *param
, int paramlen
, void *bufptr
, int buflen
);
97 extern int wl_iovar_getbuf(char *ifname
, char *iovar
, void *param
, int paramlen
, void *bufptr
, int buflen
);
98 extern int wl_iovar_set(char *ifname
, char *iovar
, void *param
, int paramlen
);
99 extern int wl_iovar_get(char *ifname
, char *iovar
, void *bufptr
, int buflen
);
100 extern int wl_iovar_setint(char *ifname
, char *iovar
, int val
);
101 extern int wl_iovar_getint(char *ifname
, char *iovar
, int *val
);
104 * Set/Get named variable indexed by BSS Configuration
105 * @param ifname interface name
106 * @param iovar variable name
107 * @param bssidx bsscfg index
108 * @param param input param value/buffer
109 * @param paramlen input param value/buffer length
110 * @param bufptr io buffer
111 * @param buflen io buffer length
112 * @param val val or val pointer for int routines
113 * @return success == 0, failure != 0
115 extern int wl_bssiovar_setbuf(char *ifname
, char *iovar
, int bssidx
, void *param
, int paramlen
, void *bufptr
, int buflen
);
116 extern int wl_bssiovar_getbuf(char *ifname
, char *iovar
, int bssidx
, void *param
, int paramlen
, void *bufptr
, int buflen
);
117 extern int wl_bssiovar_get(char *ifname
, char *iovar
, int bssidx
, void *outbuf
, int len
);
118 extern int wl_bssiovar_set(char *ifname
, char *iovar
, int bssidx
, void *param
, int paramlen
);
119 extern int wl_bssiovar_setint(char *ifname
, char *iovar
, int bssidx
, int val
);
122 #endif /* _wlutils_h_ */