2 * Wireless network adapter utilities
4 * Copyright 2004, 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.
25 if ((ret
= wl_ioctl(name
, WLC_GET_MAGIC
, &val
, sizeof(val
))))
27 if (val
!= WLC_IOCTL_MAGIC
)
29 if ((ret
= wl_ioctl(name
, WLC_GET_VERSION
, &val
, sizeof(val
))))
31 if (val
> WLC_IOCTL_VERSION
)
38 wl_set_val(char *name
, char *var
, void *val
, int len
)
43 /* check for overflow */
44 if ((buf_len
= strlen(var
)) + 1 + len
> sizeof(buf
))
50 /* append int value onto the end of the name string */
51 memcpy(&buf
[buf_len
], val
, len
);
54 return wl_ioctl(name
, WLC_SET_VAR
, buf
, buf_len
);
58 wl_get_val(char *name
, char *var
, void *val
, int len
)
63 /* check for overflow */
64 if (strlen(var
) + 1 > sizeof(buf
) || len
> sizeof(buf
))
68 if ((ret
= wl_ioctl(name
, WLC_GET_VAR
, buf
, sizeof(buf
))))
71 memcpy(val
, buf
, len
);
76 wl_set_int(char *name
, char *var
, int val
)
78 return wl_set_val(name
, var
, &val
, sizeof(val
));
82 wl_get_int(char *name
, char *var
, int *val
)
84 return wl_get_val(name
, var
, val
, sizeof(*val
));
This page took 0.048081 seconds and 5 git commands to generate.