74 #define __KERNEL_SYSCALLS__
82 #include <wl_version.h>
84 #include <linux/netdevice.h>
87 #include <asm/uaccess.h>
97 #include <wl_internal.h>
101 #include <wl_profile.h>
113 extern dbg_info_t *DbgInfo;
116 int parse_yes_no(
char *
value);
119 int parse_yes_no(
char *
value)
124 if ((value[0] | (
'Y'^
'y')) ==
'y')
172 wvlan_config = dev->priv;
173 if (wvlan_config ==
NULL) {
174 DBG_ERROR(DbgInfo,
"Wavelan specific info struct not present?\n");
188 if (file_desc != -1) {
189 DBG_TRACE(DbgInfo,
"Wireless config file found. Parsing options...\n");
197 DBG_TRACE(DbgInfo,
"No iwconfig file found for this device; "
198 "config.opts or wireless.opts will be used\n");
205 memset(&sEncryption, 0,
sizeof(sEncryption));
221 sizeof(CFG_DEFAULT_KEYS_STRCT));
226 sizeof(sEncryption));
236 sizeof(CFG_DEFAULT_KEYS_STRCT));
244 strcpy(filename,
"/etc/agere/fw.bin");
245 file_desc =
open(filename, 0, 0);
246 if (file_desc == -1) {
247 DBG_ERROR(DbgInfo,
"No image file found\n");
249 DBG_TRACE(DbgInfo,
"F/W image file found\n");
250 #define DHF_ALLOC_SIZE 96000
253 DBG_ERROR(DbgInfo,
"error in vmalloc\n");
255 rc =
read(file_desc, cp, DHF_ALLOC_SIZE);
256 if (rc == DHF_ALLOC_SIZE) {
257 DBG_ERROR(DbgInfo,
"buffer too small, %d\n", DHF_ALLOC_SIZE);
259 DBG_TRACE(DbgInfo,
"read O.K.: %d bytes %.12s\n", rc, cp);
260 rc =
read(file_desc, &cp[rc], 1);
265 DBG_ERROR(DbgInfo,
"file not read in one swoop or other error"\
266 ", give up, too complicated, rc = %0X\n", rc);
301 int readline(
int filedesc,
char *buffer)
308 if (filedesc != -1) {
310 while ((result =
read(filedesc, &buffer[bytes_read], 1)) == 1) {
311 if (buffer[bytes_read] ==
'\n') {
312 buffer[bytes_read] =
'\0';
350 unsigned int value_convert = 0;
351 int string_length = 0;
360 DBG_ERROR(DbgInfo,
"Config file buffer and/or wavelan buffer ptr NULL\n");
378 if (DbgInfo->DebugFlag == 0) {
402 lp->
brsc[0] = value_convert;
410 lp->
brsc[1] = value_convert;
414 DBG_TRACE(DbgInfo,
"SSID, value: %s\n", value);
419 string_length =
strlen(value);
421 DBG_WARNING(DbgInfo,
"SSID too long; will be truncated\n");
429 DBG_TRACE(DbgInfo,
"DOWNLOAD_FIRMWARE, value: %s\n", value);
432 string_length =
strlen(value);
434 DBG_WARNING(DbgInfo,
"F/W image file name too long; will be ignored\n");
453 string_length =
strlen(value);
525 if (value_convert > 14)
526 value_convert = value_convert | 0x100;
537 string_length =
strlen(value);
557 lp->
srsc[0] = value_convert;
565 lp->
srsc[1] = value_convert;
640 if ((value_convert >= 0) && (value_convert <= 65535))
740 lp->wds_port[0].rtsThreshold = value_convert;
748 lp->wds_port[1].rtsThreshold = value_convert;
756 lp->wds_port[2].rtsThreshold = value_convert;
764 lp->wds_port[3].rtsThreshold = value_convert;
772 lp->wds_port[4].rtsThreshold = value_convert;
780 lp->wds_port[5].rtsThreshold = value_convert;
788 lp->wds_port[0].txRateCntl = value_convert;
796 lp->wds_port[1].txRateCntl = value_convert;
804 lp->wds_port[2].txRateCntl = value_convert;
812 lp->wds_port[3].txRateCntl = value_convert;
820 lp->wds_port[4].txRateCntl = value_convert;
828 lp->wds_port[5].txRateCntl = value_convert;
905 int array_offset = 0;
906 int field_offset = 0;
910 memset(byte_field,
'\0', 3);
912 while (value[value_offset] !=
'\0') {
914 if (value[value_offset] ==
':') {
924 if (field_offset == 2) {
925 byte_field[field_offset] =
'\0';
972 if (pszLine[0] !=
'#' &&
973 pszLine[0] !=
'\n' &&
974 !(pszLine[0] ==
'\r' && pszLine[1] ==
'\n')
977 for (i = 0; i <
size; i++) {
978 if (pszLine[i] !=
' ') {
979 *ppszLVal = &pszLine[
i];
984 for (i++; i <
size; i++) {
985 if (pszLine[i] ==
' ' || pszLine[i] ==
'=') {
992 for (i++; i <
size; i++) {
993 if (pszLine[i] ==
' ' || pszLine[i] ==
'=') {
997 *ppszRVal = &pszLine[
i];
1001 for (i++; i <
size; i++) {
1002 if (pszLine[i] ==
'\n')
1004 if ((pszLine[i] ==
'\r') && (pszLine[i+1] ==
'\n'))