1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
/*
* Header file for API-compatible handling routines
*
*
*
* Copyright (c) 2009 Realtek Semiconductor Corp.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef _8192CD_COMAPI_H_
#define _8192CD_COMAPI_H_
#include "./8192cd.h"
typedef struct rtl8192cd_priv RTL_PRIV;
#define MAX_CONFIG_FILE_SIZE (20*1024) // for 8192, added to 20k
#define MAX_PARAM_BUF_SIZE (1024) // for 8192, added to 20k
#ifdef CONFIG_RTL_COMAPI_CFGFILE
/* Following is a example for PARAMETERs completely compatible to other vendors'
* configure file - chris 2010/02/01 */
#undef VENDOR_PARAM_COMPATIBLE
#ifdef VENDOR_PARAM_COMPATIBLE
int Set_CountryRegion_Proc (RTL_PRIV *priv, char *arg);
int Set_CountryRegionABand_Proc (RTL_PRIV *priv, char *arg);
int Set_SSID_Proc (RTL_PRIV *priv, char *arg);
struct mib_cfg_func{
char name[20]; /*mib name*/
int (*set_proc)(RTL_PRIV *priv, char *arg);
};
static struct mib_cfg_func *TMP_MIBCFG, RTL_SUPPORT_MIBCFG[] = {
{"CountryRegion", Set_CountryRegion_Proc},
{"CountryRegionABand", Set_CountryRegionABand_Proc},
{"SSID", Set_SSID_Proc}
};
int Set_CountryRegion_Proc(RTL_PRIV *priv, char *arg)
{
int val = simple_strtol(arg, 0 ,10);
if (DOMAIN_FCC <= val && val <= DOMAIN_MAX ) {
priv->pmib->dot11StationConfigEntry.dot11RegDomain = val;
return TRUE;
} else {
printk("contry region out of range [%d-%d]\n", DOMAIN_FCC, DOMAIN_MAX);
return FALSE;
}
}
int Set_CountryRegionABand_Proc(RTL_PRIV *priv, char *arg)
{
int val = simple_strtol(arg, 0 ,10);
priv->pmib->dot11StationConfigEntry.dot11RegDomainABand = val;
return TRUE;
}
int Set_SSID_Proc(RTL_PRIV *priv, char *arg)
{
strcpy(priv->pmib->dot11StationConfigEntry.dot11DesiredSSID, arg);
return TRUE;
}
#else
extern int set_mib(struct rtl8192cd_priv *priv, unsigned char *data);
#endif //VENDOR_PARAM_COMPATIBLE
#endif //CONFIG_RTL_COMAPI_CFGFILE
#endif // _8192CD_COMAPI_H_
|