2 *************************************************************************
4 * 5F., No.36, Taiyuan St., Jhubei City,
8 * (c) Copyright 2002-2007, Ralink Technology, Inc.
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
15 * This program is distributed in the hope that it will be useful, *
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
18 * GNU General Public License for more details. *
20 * You should have received a copy of the GNU General Public License *
21 * along with this program; if not, write to the *
22 * Free Software Foundation, Inc., *
23 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
25 *************************************************************************
34 --------- ---------- ----------------------------------------------
37 #include "rt_config.h"
40 NDIS_STATUS
RTMPReadParametersHook(
45 RTMP_OS_FS_INFO osFSInfo
;
46 INT retval
= NDIS_STATUS_FAILURE
;
49 buffer
= kmalloc(MAX_INI_BUFFER_SIZE
, MEM_ALLOC_FLAG
);
51 return NDIS_STATUS_FAILURE
;
52 memset(buffer
, 0x00, MAX_INI_BUFFER_SIZE
);
56 #ifdef CONFIG_STA_SUPPORT
57 IF_DEV_CONFIG_OPMODE_ON_STA(pAd
)
59 src
= STA_PROFILE_PATH
;
61 #endif // CONFIG_STA_SUPPORT //
62 #ifdef MULTIPLE_CARD_SUPPORT
63 src
= (PSTRING
)pAd
->MC_FileName
;
64 #endif // MULTIPLE_CARD_SUPPORT //
69 RtmpOSFSInfoChange(&osFSInfo
, TRUE
);
70 srcf
= RtmpOSFileOpen(src
, O_RDONLY
, 0);
71 if (IS_FILE_OPEN_ERR(srcf
))
73 DBGPRINT(RT_DEBUG_ERROR
, ("Open file \"%s\" failed!\n", src
));
77 retval
=RtmpOSFileRead(srcf
, buffer
, MAX_INI_BUFFER_SIZE
);
80 RTMPSetProfileParameters(pAd
, buffer
);
81 retval
= NDIS_STATUS_SUCCESS
;
84 DBGPRINT(RT_DEBUG_ERROR
, ("Read file \"%s\" failed(errCode=%d)!\n", src
, retval
));
86 retval
= RtmpOSFileClose(srcf
);
89 retval
= NDIS_STATUS_FAILURE
;
90 DBGPRINT(RT_DEBUG_ERROR
, ("Close file \"%s\" failed(errCode=%d)!\n", src
, retval
));
94 RtmpOSFSInfoChange(&osFSInfo
, FALSE
);